{"action":"closed","issue":{"url":"https://api.github.com/repos/keunwoochoi/residual_block_keras/issues/12","repository_url":"https://api.github.com/repos/keunwoochoi/residual_block_keras","labels_url":"https://api.github.com/repos/keunwoochoi/residual_block_keras/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/keunwoochoi/residual_block_keras/issues/12/comments","events_url":"https://api.github.com/repos/keunwoochoi/residual_block_keras/issues/12/events","html_url":"https://github.com/keunwoochoi/residual_block_keras/issues/12","id":184750896,"number":12,"title":"details on the code","user":{"login":"anewlearner","id":10386613,"avatar_url":"https://avatars.githubusercontent.com/u/10386613?v=3","gravatar_id":"","url":"https://api.github.com/users/anewlearner","html_url":"https://github.com/anewlearner","followers_url":"https://api.github.com/users/anewlearner/followers","following_url":"https://api.github.com/users/anewlearner/following{/other_user}","gists_url":"https://api.github.com/users/anewlearner/gists{/gist_id}","starred_url":"https://api.github.com/users/anewlearner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anewlearner/subscriptions","organizations_url":"https://api.github.com/users/anewlearner/orgs","repos_url":"https://api.github.com/users/anewlearner/repos","events_url":"https://api.github.com/users/anewlearner/events{/privacy}","received_events_url":"https://api.github.com/users/anewlearner/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-24T05:20:08Z","updated_at":"2016-12-10T16:57:06Z","closed_at":"2016-12-10T16:57:06Z","body":"@keunwoochoi\nThanks for sharing your code. It's really a great help.\nI have some questions about the details and I am not sure if my understanding is true. Hope you can help.\n- You used `batchnorm->relu->conv`. But it seems to be `conv->batchnorm->relu` in the paper.\n\n```\nfor i in range(n_skip):\n        conv_y = BatchNormalization(axis=1, mode=2)(conv_y)       \n        conv_y = Activation('relu')(conv_y)\n        if i==0 and is_subsample: # [Subsample at layer 0 if needed]\n            conv_y = Convolution2D(n_feature_maps, kernel_row, kernel_col,\n                                    subsample=subsample,\n                                    border_mode='valid')(conv_y) \n        else:       \n            conv_y = Convolution2D(n_feature_maps, kernel_row, kernel_col, border_mode='same')(conv_y)\n```\n- The description of the code seems to be inconsistent to the code.\n\n> MaxPooling is used instead of strided convolution to make it easier \n>         to set size(output of short-cut) == size(output of conv-layers).\n>         If you want to remove MaxPooling,\n>            i) change (border_mode in Convolution2D in shortcut), 'same'-->'valid'\n>            ii) uncomment ZeroPadding2D in conv layers.\n>                (Then the following Conv2D is not the first layer of this container anymore,\n>                 so you can remove the input_shape in the line 101, the line with comment #'OPTION' )\n\nActually, strided convolution is used instead of MaxPooling. \nI changed the code to use MaxPooling.\n(i)\n\n```\nif is_subsample: # subsample (+ channel expansion if needed)\n#    shortcut_y = Convolution2D(n_feature_maps, kernel_sizes[0], kernel_sizes[1],\n#                               subsample=subsample,\n#                               border_mode='valid')(x)\n    shortcut_y = Convolution2D(n_feature_maps, kernel_sizes[0], kernel_sizes[1],\n                               border_mode='same')(x)\n    shortcut_y = MaxPooling3D(pool_size=(2, 2, 2)))\nelse: # channel expansion only (e.g. the very first layer of the whole networks)\n    if is_expand_channels:\n        shortcut_y = Convolution2D(n_feature_maps, 1, 1, border_mode='same')(x)\n    else:\n    # if no subsample and no channel expension, there's nothing to add on the shortcut.\n    shortcut_y = x\n```\n\n(ii) comment ZeroPadding2D in conv layers.\n"}}
{"actor":{"display_login":"keunwoochoi"}}