{"action":"created","comment":{"url":"https://api.github.com/repos/PaddlePaddle/models/pulls/comments/120049439","pull_request_review_id":41979939,"id":120049439,"diff_hunk":"@@ -0,0 +1,95 @@\n+import paddle.v2 as paddle\n+\n+__all__ = ['resnet_imagenet', 'resnet_cifar10']\n+\n+\n+def conv_bn_layer(input,\n+                  ch_out,\n+                  filter_size,\n+                  stride,\n+                  padding,\n+                  active_type=paddle.activation.Relu(),\n+                  ch_in=None):\n+    tmp = paddle.layer.img_conv(\n+        input=input,\n+        filter_size=filter_size,\n+        num_channels=ch_in,\n+        num_filters=ch_out,\n+        stride=stride,\n+        padding=padding,\n+        act=paddle.activation.Linear(),\n+        bias_attr=False)\n+    return paddle.layer.batch_norm(input=tmp, act=active_type)\n+\n+\n+def shortcut(input, n_out, stride, b_projection):\n+    if b_projection:\n+        return conv_bn_layer(input, n_out, 1, stride, 0,\n+                             paddle.activation.Linear())\n+    else:\n+        return input\n+\n+\n+def basicblock(input, ch_out, stride, b_projection):\n+    conv1 = conv_bn_layer(input, ch_out, 3, stride, 1)\n+    conv2 = conv_bn_layer(conv1, ch_out, 3, 1, 1, paddle.activation.Linear())\n+    short = shortcut(input, ch_out, stride, b_projection)\n+    return paddle.layer.addto(\n+        input=[conv2, short], act=paddle.activation.Relu())\n+\n+\n+def bottleneck(input, ch_out, stride, b_projection):\n+    conv1 = conv_bn_layer(input, ch_out, 1, stride, 0)\n+    conv2 = conv_bn_layer(conv1, ch_out, 3, 1, 1)\n+    conv3 = conv_bn_layer(conv2, ch_out * 4, 1, 1, 0,\n+                          paddle.activation.Linear())\n+    short = shortcut(input, ch_out * 4, stride, b_projection)\n+    return paddle.layer.addto(\n+        input=[conv3, short], act=paddle.activation.Relu())\n+\n+\n+def layer_warp(block_func, input, features, count, stride):\n+    conv = block_func(input, features, stride, True)","path":"image_classification/resnet.py","position":52,"original_position":52,"commit_id":"d7d1ae5a9eb8a02ea63af2e55fb782ab74e2a1a9","original_commit_id":"d7d1ae5a9eb8a02ea63af2e55fb782ab74e2a1a9","user":{"login":"qingqing01","id":7845005,"avatar_url":"https://avatars3.githubusercontent.com/u/7845005?v=3","gravatar_id":"","url":"https://api.github.com/users/qingqing01","html_url":"https://github.com/qingqing01","followers_url":"https://api.github.com/users/qingqing01/followers","following_url":"https://api.github.com/users/qingqing01/following{/other_user}","gists_url":"https://api.github.com/users/qingqing01/gists{/gist_id}","starred_url":"https://api.github.com/users/qingqing01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qingqing01/subscriptions","organizations_url":"https://api.github.com/users/qingqing01/orgs","repos_url":"https://api.github.com/users/qingqing01/repos","events_url":"https://api.github.com/users/qingqing01/events{/privacy}","received_events_url":"https://api.github.com/users/qingqing01/received_events","type":"User","site_admin":false},"body":"第一个block_func的`b_projection`不是总为`True`的，还是的依赖于输入conv的channel数。 所以我觉得还是`shortcut`里对判断输入和输出的channel数是否一致，决定是否用conv做升降维度好些~","created_at":"2017-06-05T06:38:28Z","updated_at":"2017-06-05T06:42:44Z","html_url":"https://github.com/PaddlePaddle/models/pull/52#discussion_r120049439","pull_request_url":"https://api.github.com/repos/PaddlePaddle/models/pulls/52","_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/models/pulls/comments/120049439"},"html":{"href":"https://github.com/PaddlePaddle/models/pull/52#discussion_r120049439"},"pull_request":{"href":"https://api.github.com/repos/PaddlePaddle/models/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/PaddlePaddle/models/pulls/52","id":122187540,"html_url":"https://github.com/PaddlePaddle/models/pull/52","diff_url":"https://github.com/PaddlePaddle/models/pull/52.diff","patch_url":"https://github.com/PaddlePaddle/models/pull/52.patch","issue_url":"https://api.github.com/repos/PaddlePaddle/models/issues/52","number":52,"state":"open","locked":false,"title":"Add image classification models","user":{"login":"wwhu","id":6081200,"avatar_url":"https://avatars0.githubusercontent.com/u/6081200?v=3","gravatar_id":"","url":"https://api.github.com/users/wwhu","html_url":"https://github.com/wwhu","followers_url":"https://api.github.com/users/wwhu/followers","following_url":"https://api.github.com/users/wwhu/following{/other_user}","gists_url":"https://api.github.com/users/wwhu/gists{/gist_id}","starred_url":"https://api.github.com/users/wwhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwhu/subscriptions","organizations_url":"https://api.github.com/users/wwhu/orgs","repos_url":"https://api.github.com/users/wwhu/repos","events_url":"https://api.github.com/users/wwhu/events{/privacy}","received_events_url":"https://api.github.com/users/wwhu/received_events","type":"User","site_admin":false},"body":"resolve #28 \r\nThe classification accuracy has not been validated yet.","created_at":"2017-05-24T09:51:33Z","updated_at":"2017-06-05T06:42:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03e0f7f9f6439fc8f56512b717ca76d7643951da","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/PaddlePaddle/models/pulls/52/commits","review_comments_url":"https://api.github.com/repos/PaddlePaddle/models/pulls/52/comments","review_comment_url":"https://api.github.com/repos/PaddlePaddle/models/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PaddlePaddle/models/issues/52/comments","statuses_url":"https://api.github.com/repos/PaddlePaddle/models/statuses/d7d1ae5a9eb8a02ea63af2e55fb782ab74e2a1a9","head":{"label":"wwhu:in-dev","ref":"in-dev","sha":"d7d1ae5a9eb8a02ea63af2e55fb782ab74e2a1a9","user":{"login":"wwhu","id":6081200,"avatar_url":"https://avatars0.githubusercontent.com/u/6081200?v=3","gravatar_id":"","url":"https://api.github.com/users/wwhu","html_url":"https://github.com/wwhu","followers_url":"https://api.github.com/users/wwhu/followers","following_url":"https://api.github.com/users/wwhu/following{/other_user}","gists_url":"https://api.github.com/users/wwhu/gists{/gist_id}","starred_url":"https://api.github.com/users/wwhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwhu/subscriptions","organizations_url":"https://api.github.com/users/wwhu/orgs","repos_url":"https://api.github.com/users/wwhu/repos","events_url":"https://api.github.com/users/wwhu/events{/privacy}","received_events_url":"https://api.github.com/users/wwhu/received_events","type":"User","site_admin":false},"repo":{"id":90247332,"name":"models","full_name":"wwhu/models","owner":{"login":"wwhu","id":6081200,"avatar_url":"https://avatars0.githubusercontent.com/u/6081200?v=3","gravatar_id":"","url":"https://api.github.com/users/wwhu","html_url":"https://github.com/wwhu","followers_url":"https://api.github.com/users/wwhu/followers","following_url":"https://api.github.com/users/wwhu/following{/other_user}","gists_url":"https://api.github.com/users/wwhu/gists{/gist_id}","starred_url":"https://api.github.com/users/wwhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwhu/subscriptions","organizations_url":"https://api.github.com/users/wwhu/orgs","repos_url":"https://api.github.com/users/wwhu/repos","events_url":"https://api.github.com/users/wwhu/events{/privacy}","received_events_url":"https://api.github.com/users/wwhu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wwhu/models","description":"Model configureations","fork":true,"url":"https://api.github.com/repos/wwhu/models","forks_url":"https://api.github.com/repos/wwhu/models/forks","keys_url":"https://api.github.com/repos/wwhu/models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wwhu/models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wwhu/models/teams","hooks_url":"https://api.github.com/repos/wwhu/models/hooks","issue_events_url":"https://api.github.com/repos/wwhu/models/issues/events{/number}","events_url":"https://api.github.com/repos/wwhu/models/events","assignees_url":"https://api.github.com/repos/wwhu/models/assignees{/user}","branches_url":"https://api.github.com/repos/wwhu/models/branches{/branch}","tags_url":"https://api.github.com/repos/wwhu/models/tags","blobs_url":"https://api.github.com/repos/wwhu/models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wwhu/models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wwhu/models/git/refs{/sha}","trees_url":"https://api.github.com/repos/wwhu/models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wwhu/models/statuses/{sha}","languages_url":"https://api.github.com/repos/wwhu/models/languages","stargazers_url":"https://api.github.com/repos/wwhu/models/stargazers","contributors_url":"https://api.github.com/repos/wwhu/models/contributors","subscribers_url":"https://api.github.com/repos/wwhu/models/subscribers","subscription_url":"https://api.github.com/repos/wwhu/models/subscription","commits_url":"https://api.github.com/repos/wwhu/models/commits{/sha}","git_commits_url":"https://api.github.com/repos/wwhu/models/git/commits{/sha}","comments_url":"https://api.github.com/repos/wwhu/models/comments{/number}","issue_comment_url":"https://api.github.com/repos/wwhu/models/issues/comments{/number}","contents_url":"https://api.github.com/repos/wwhu/models/contents/{+path}","compare_url":"https://api.github.com/repos/wwhu/models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wwhu/models/merges","archive_url":"https://api.github.com/repos/wwhu/models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wwhu/models/downloads","issues_url":"https://api.github.com/repos/wwhu/models/issues{/number}","pulls_url":"https://api.github.com/repos/wwhu/models/pulls{/number}","milestones_url":"https://api.github.com/repos/wwhu/models/milestones{/number}","notifications_url":"https://api.github.com/repos/wwhu/models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wwhu/models/labels{/name}","releases_url":"https://api.github.com/repos/wwhu/models/releases{/id}","deployments_url":"https://api.github.com/repos/wwhu/models/deployments","created_at":"2017-05-04T09:47:34Z","updated_at":"2017-05-04T09:47:36Z","pushed_at":"2017-06-02T06:00:25Z","git_url":"git://github.com/wwhu/models.git","ssh_url":"git@github.com:wwhu/models.git","clone_url":"https://github.com/wwhu/models.git","svn_url":"https://github.com/wwhu/models","homepage":null,"size":2516,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"PaddlePaddle:develop","ref":"develop","sha":"d5cc1155159b7d5f03454ca615603f18bb1b3d0c","user":{"login":"PaddlePaddle","id":23534030,"avatar_url":"https://avatars0.githubusercontent.com/u/23534030?v=3","gravatar_id":"","url":"https://api.github.com/users/PaddlePaddle","html_url":"https://github.com/PaddlePaddle","followers_url":"https://api.github.com/users/PaddlePaddle/followers","following_url":"https://api.github.com/users/PaddlePaddle/following{/other_user}","gists_url":"https://api.github.com/users/PaddlePaddle/gists{/gist_id}","starred_url":"https://api.github.com/users/PaddlePaddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaddlePaddle/subscriptions","organizations_url":"https://api.github.com/users/PaddlePaddle/orgs","repos_url":"https://api.github.com/users/PaddlePaddle/repos","events_url":"https://api.github.com/users/PaddlePaddle/events{/privacy}","received_events_url":"https://api.github.com/users/PaddlePaddle/received_events","type":"Organization","site_admin":false},"repo":{"id":88868842,"name":"models","full_name":"PaddlePaddle/models","owner":{"login":"PaddlePaddle","id":23534030,"avatar_url":"https://avatars0.githubusercontent.com/u/23534030?v=3","gravatar_id":"","url":"https://api.github.com/users/PaddlePaddle","html_url":"https://github.com/PaddlePaddle","followers_url":"https://api.github.com/users/PaddlePaddle/followers","following_url":"https://api.github.com/users/PaddlePaddle/following{/other_user}","gists_url":"https://api.github.com/users/PaddlePaddle/gists{/gist_id}","starred_url":"https://api.github.com/users/PaddlePaddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaddlePaddle/subscriptions","organizations_url":"https://api.github.com/users/PaddlePaddle/orgs","repos_url":"https://api.github.com/users/PaddlePaddle/repos","events_url":"https://api.github.com/users/PaddlePaddle/events{/privacy}","received_events_url":"https://api.github.com/users/PaddlePaddle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PaddlePaddle/models","description":"Model configurations","fork":false,"url":"https://api.github.com/repos/PaddlePaddle/models","forks_url":"https://api.github.com/repos/PaddlePaddle/models/forks","keys_url":"https://api.github.com/repos/PaddlePaddle/models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PaddlePaddle/models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PaddlePaddle/models/teams","hooks_url":"https://api.github.com/repos/PaddlePaddle/models/hooks","issue_events_url":"https://api.github.com/repos/PaddlePaddle/models/issues/events{/number}","events_url":"https://api.github.com/repos/PaddlePaddle/models/events","assignees_url":"https://api.github.com/repos/PaddlePaddle/models/assignees{/user}","branches_url":"https://api.github.com/repos/PaddlePaddle/models/branches{/branch}","tags_url":"https://api.github.com/repos/PaddlePaddle/models/tags","blobs_url":"https://api.github.com/repos/PaddlePaddle/models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PaddlePaddle/models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PaddlePaddle/models/git/refs{/sha}","trees_url":"https://api.github.com/repos/PaddlePaddle/models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PaddlePaddle/models/statuses/{sha}","languages_url":"https://api.github.com/repos/PaddlePaddle/models/languages","stargazers_url":"https://api.github.com/repos/PaddlePaddle/models/stargazers","contributors_url":"https://api.github.com/repos/PaddlePaddle/models/contributors","subscribers_url":"https://api.github.com/repos/PaddlePaddle/models/subscribers","subscription_url":"https://api.github.com/repos/PaddlePaddle/models/subscription","commits_url":"https://api.github.com/repos/PaddlePaddle/models/commits{/sha}","git_commits_url":"https://api.github.com/repos/PaddlePaddle/models/git/commits{/sha}","comments_url":"https://api.github.com/repos/PaddlePaddle/models/comments{/number}","issue_comment_url":"https://api.github.com/repos/PaddlePaddle/models/issues/comments{/number}","contents_url":"https://api.github.com/repos/PaddlePaddle/models/contents/{+path}","compare_url":"https://api.github.com/repos/PaddlePaddle/models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PaddlePaddle/models/merges","archive_url":"https://api.github.com/repos/PaddlePaddle/models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PaddlePaddle/models/downloads","issues_url":"https://api.github.com/repos/PaddlePaddle/models/issues{/number}","pulls_url":"https://api.github.com/repos/PaddlePaddle/models/pulls{/number}","milestones_url":"https://api.github.com/repos/PaddlePaddle/models/milestones{/number}","notifications_url":"https://api.github.com/repos/PaddlePaddle/models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PaddlePaddle/models/labels{/name}","releases_url":"https://api.github.com/repos/PaddlePaddle/models/releases{/id}","deployments_url":"https://api.github.com/repos/PaddlePaddle/models/deployments","created_at":"2017-04-20T13:30:15Z","updated_at":"2017-06-02T08:39:59Z","pushed_at":"2017-06-05T03:14:41Z","git_url":"git://github.com/PaddlePaddle/models.git","ssh_url":"git@github.com:PaddlePaddle/models.git","clone_url":"https://github.com/PaddlePaddle/models.git","svn_url":"https://github.com/PaddlePaddle/models","homepage":"","size":36069,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":29,"forks":18,"open_issues":29,"watchers":9,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/models/pulls/52"},"html":{"href":"https://github.com/PaddlePaddle/models/pull/52"},"issue":{"href":"https://api.github.com/repos/PaddlePaddle/models/issues/52"},"comments":{"href":"https://api.github.com/repos/PaddlePaddle/models/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/PaddlePaddle/models/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/PaddlePaddle/models/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PaddlePaddle/models/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/PaddlePaddle/models/statuses/d7d1ae5a9eb8a02ea63af2e55fb782ab74e2a1a9"}}}}
{"actor":{"display_login":"qingqing01"}}