{"action":"created","comment":{"url":"https://api.github.com/repos/fchollet/keras/pulls/comments/70037684","id":70037684,"diff_hunk":"@@ -256,70 +286,26 @@ def __init__(self, nb_filter, nb_row, nb_col,\n                  W_regularizer=None, b_regularizer=None, activity_regularizer=None,\n                  W_constraint=None, b_constraint=None,\n                  bias=True, **kwargs):\n-\n-        if border_mode not in {'valid', 'same'}:\n-            raise Exception('Invalid border mode for Convolution2D:', border_mode)\n-        self.nb_filter = nb_filter\n+        super(Convolution2D, self).__init__(nb_filter, dimensions=(nb_row, nb_col), init=init,\n+                                            activation=activation, weights=weights,\n+                                            border_mode=border_mode, subsample=subsample,\n+                                            W_regularizer=W_regularizer, b_regularizer=b_regularizer,\n+                                            activity_regularizer=activity_regularizer, W_constraint=W_constraint,\n+                                            b_constraint=b_constraint, bias=bias,\n+                                            **kwargs)\n         self.nb_row = nb_row\n         self.nb_col = nb_col\n-        self.init = initializations.get(init, dim_ordering=dim_ordering)\n-        self.activation = activations.get(activation)\n-        assert border_mode in {'valid', 'same'}, 'border_mode must be in {valid, same}'\n-        self.border_mode = border_mode\n-        self.subsample = tuple(subsample)\n-        assert dim_ordering in {'tf', 'th'}, 'dim_ordering must be in {tf, th}'\n-        self.dim_ordering = dim_ordering\n-\n-        self.W_regularizer = regularizers.get(W_regularizer)","path":"keras/layers/convolutional.py","position":231,"original_position":231,"commit_id":"bcbe7c559a48f27878f084ddeb93bb7eab7aa1a6","original_commit_id":"bcbe7c559a48f27878f084ddeb93bb7eab7aa1a6","user":{"login":"MikeAmy","id":496954,"avatar_url":"https://avatars.githubusercontent.com/u/496954?v=3","gravatar_id":"","url":"https://api.github.com/users/MikeAmy","html_url":"https://github.com/MikeAmy","followers_url":"https://api.github.com/users/MikeAmy/followers","following_url":"https://api.github.com/users/MikeAmy/following{/other_user}","gists_url":"https://api.github.com/users/MikeAmy/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeAmy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeAmy/subscriptions","organizations_url":"https://api.github.com/users/MikeAmy/orgs","repos_url":"https://api.github.com/users/MikeAmy/repos","events_url":"https://api.github.com/users/MikeAmy/events{/privacy}","received_events_url":"https://api.github.com/users/MikeAmy/received_events","type":"User","site_admin":false},"body":"These lines are duplicated pretty much verbatim.","created_at":"2016-07-08T07:52:15Z","updated_at":"2016-07-08T07:52:15Z","html_url":"https://github.com/fchollet/keras/pull/3175#discussion_r70037684","pull_request_url":"https://api.github.com/repos/fchollet/keras/pulls/3175","_links":{"self":{"href":"https://api.github.com/repos/fchollet/keras/pulls/comments/70037684"},"html":{"href":"https://github.com/fchollet/keras/pull/3175#discussion_r70037684"},"pull_request":{"href":"https://api.github.com/repos/fchollet/keras/pulls/3175"}}},"pull_request":{"url":"https://api.github.com/repos/fchollet/keras/pulls/3175","id":76711833,"html_url":"https://github.com/fchollet/keras/pull/3175","diff_url":"https://github.com/fchollet/keras/pull/3175.diff","patch_url":"https://github.com/fchollet/keras/pull/3175.patch","issue_url":"https://api.github.com/repos/fchollet/keras/issues/3175","number":3175,"state":"open","locked":false,"title":"De-duplicated convolutional layer code.","user":{"login":"MikeAmy","id":496954,"avatar_url":"https://avatars.githubusercontent.com/u/496954?v=3","gravatar_id":"","url":"https://api.github.com/users/MikeAmy","html_url":"https://github.com/MikeAmy","followers_url":"https://api.github.com/users/MikeAmy/followers","following_url":"https://api.github.com/users/MikeAmy/following{/other_user}","gists_url":"https://api.github.com/users/MikeAmy/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeAmy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeAmy/subscriptions","organizations_url":"https://api.github.com/users/MikeAmy/orgs","repos_url":"https://api.github.com/users/MikeAmy/repos","events_url":"https://api.github.com/users/MikeAmy/events{/privacy}","received_events_url":"https://api.github.com/users/MikeAmy/received_events","type":"User","site_admin":false},"body":"Extracted AbstractConvolution super class.\r\nConvolution layers have a common 'dimensions' attribute that gives the dimensions.","created_at":"2016-07-08T07:27:24Z","updated_at":"2016-07-08T07:52:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3c5e017a2214ceb989cfeab7b35a0f174469ec2b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/fchollet/keras/pulls/3175/commits","review_comments_url":"https://api.github.com/repos/fchollet/keras/pulls/3175/comments","review_comment_url":"https://api.github.com/repos/fchollet/keras/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/3175/comments","statuses_url":"https://api.github.com/repos/fchollet/keras/statuses/bcbe7c559a48f27878f084ddeb93bb7eab7aa1a6","head":{"label":"MikeAmy:master","ref":"master","sha":"bcbe7c559a48f27878f084ddeb93bb7eab7aa1a6","user":{"login":"MikeAmy","id":496954,"avatar_url":"https://avatars.githubusercontent.com/u/496954?v=3","gravatar_id":"","url":"https://api.github.com/users/MikeAmy","html_url":"https://github.com/MikeAmy","followers_url":"https://api.github.com/users/MikeAmy/followers","following_url":"https://api.github.com/users/MikeAmy/following{/other_user}","gists_url":"https://api.github.com/users/MikeAmy/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeAmy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeAmy/subscriptions","organizations_url":"https://api.github.com/users/MikeAmy/orgs","repos_url":"https://api.github.com/users/MikeAmy/repos","events_url":"https://api.github.com/users/MikeAmy/events{/privacy}","received_events_url":"https://api.github.com/users/MikeAmy/received_events","type":"User","site_admin":false},"repo":{"id":61214278,"name":"keras","full_name":"MikeAmy/keras","owner":{"login":"MikeAmy","id":496954,"avatar_url":"https://avatars.githubusercontent.com/u/496954?v=3","gravatar_id":"","url":"https://api.github.com/users/MikeAmy","html_url":"https://github.com/MikeAmy","followers_url":"https://api.github.com/users/MikeAmy/followers","following_url":"https://api.github.com/users/MikeAmy/following{/other_user}","gists_url":"https://api.github.com/users/MikeAmy/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeAmy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeAmy/subscriptions","organizations_url":"https://api.github.com/users/MikeAmy/orgs","repos_url":"https://api.github.com/users/MikeAmy/repos","events_url":"https://api.github.com/users/MikeAmy/events{/privacy}","received_events_url":"https://api.github.com/users/MikeAmy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MikeAmy/keras","description":"Deep Learning library for Python. Convnets, recurrent neural networks, and more. Runs on Theano and TensorFlow.","fork":true,"url":"https://api.github.com/repos/MikeAmy/keras","forks_url":"https://api.github.com/repos/MikeAmy/keras/forks","keys_url":"https://api.github.com/repos/MikeAmy/keras/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MikeAmy/keras/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MikeAmy/keras/teams","hooks_url":"https://api.github.com/repos/MikeAmy/keras/hooks","issue_events_url":"https://api.github.com/repos/MikeAmy/keras/issues/events{/number}","events_url":"https://api.github.com/repos/MikeAmy/keras/events","assignees_url":"https://api.github.com/repos/MikeAmy/keras/assignees{/user}","branches_url":"https://api.github.com/repos/MikeAmy/keras/branches{/branch}","tags_url":"https://api.github.com/repos/MikeAmy/keras/tags","blobs_url":"https://api.github.com/repos/MikeAmy/keras/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MikeAmy/keras/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MikeAmy/keras/git/refs{/sha}","trees_url":"https://api.github.com/repos/MikeAmy/keras/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MikeAmy/keras/statuses/{sha}","languages_url":"https://api.github.com/repos/MikeAmy/keras/languages","stargazers_url":"https://api.github.com/repos/MikeAmy/keras/stargazers","contributors_url":"https://api.github.com/repos/MikeAmy/keras/contributors","subscribers_url":"https://api.github.com/repos/MikeAmy/keras/subscribers","subscription_url":"https://api.github.com/repos/MikeAmy/keras/subscription","commits_url":"https://api.github.com/repos/MikeAmy/keras/commits{/sha}","git_commits_url":"https://api.github.com/repos/MikeAmy/keras/git/commits{/sha}","comments_url":"https://api.github.com/repos/MikeAmy/keras/comments{/number}","issue_comment_url":"https://api.github.com/repos/MikeAmy/keras/issues/comments{/number}","contents_url":"https://api.github.com/repos/MikeAmy/keras/contents/{+path}","compare_url":"https://api.github.com/repos/MikeAmy/keras/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MikeAmy/keras/merges","archive_url":"https://api.github.com/repos/MikeAmy/keras/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MikeAmy/keras/downloads","issues_url":"https://api.github.com/repos/MikeAmy/keras/issues{/number}","pulls_url":"https://api.github.com/repos/MikeAmy/keras/pulls{/number}","milestones_url":"https://api.github.com/repos/MikeAmy/keras/milestones{/number}","notifications_url":"https://api.github.com/repos/MikeAmy/keras/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MikeAmy/keras/labels{/name}","releases_url":"https://api.github.com/repos/MikeAmy/keras/releases{/id}","deployments_url":"https://api.github.com/repos/MikeAmy/keras/deployments","created_at":"2016-06-15T14:24:30Z","updated_at":"2016-06-15T14:24:32Z","pushed_at":"2016-07-08T07:26:08Z","git_url":"git://github.com/MikeAmy/keras.git","ssh_url":"git@github.com:MikeAmy/keras.git","clone_url":"https://github.com/MikeAmy/keras.git","svn_url":"https://github.com/MikeAmy/keras","homepage":"http://keras.io/","size":3221,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"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":"master"}},"base":{"label":"fchollet:master","ref":"master","sha":"a78ad01bb44137f206dc8167626ea8cf73c7958b","user":{"login":"fchollet","id":710255,"avatar_url":"https://avatars.githubusercontent.com/u/710255?v=3","gravatar_id":"","url":"https://api.github.com/users/fchollet","html_url":"https://github.com/fchollet","followers_url":"https://api.github.com/users/fchollet/followers","following_url":"https://api.github.com/users/fchollet/following{/other_user}","gists_url":"https://api.github.com/users/fchollet/gists{/gist_id}","starred_url":"https://api.github.com/users/fchollet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fchollet/subscriptions","organizations_url":"https://api.github.com/users/fchollet/orgs","repos_url":"https://api.github.com/users/fchollet/repos","events_url":"https://api.github.com/users/fchollet/events{/privacy}","received_events_url":"https://api.github.com/users/fchollet/received_events","type":"User","site_admin":false},"repo":{"id":33015583,"name":"keras","full_name":"fchollet/keras","owner":{"login":"fchollet","id":710255,"avatar_url":"https://avatars.githubusercontent.com/u/710255?v=3","gravatar_id":"","url":"https://api.github.com/users/fchollet","html_url":"https://github.com/fchollet","followers_url":"https://api.github.com/users/fchollet/followers","following_url":"https://api.github.com/users/fchollet/following{/other_user}","gists_url":"https://api.github.com/users/fchollet/gists{/gist_id}","starred_url":"https://api.github.com/users/fchollet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fchollet/subscriptions","organizations_url":"https://api.github.com/users/fchollet/orgs","repos_url":"https://api.github.com/users/fchollet/repos","events_url":"https://api.github.com/users/fchollet/events{/privacy}","received_events_url":"https://api.github.com/users/fchollet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fchollet/keras","description":"Deep Learning library for Python. Convnets, recurrent neural networks, and more. Runs on Theano and TensorFlow.","fork":false,"url":"https://api.github.com/repos/fchollet/keras","forks_url":"https://api.github.com/repos/fchollet/keras/forks","keys_url":"https://api.github.com/repos/fchollet/keras/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fchollet/keras/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fchollet/keras/teams","hooks_url":"https://api.github.com/repos/fchollet/keras/hooks","issue_events_url":"https://api.github.com/repos/fchollet/keras/issues/events{/number}","events_url":"https://api.github.com/repos/fchollet/keras/events","assignees_url":"https://api.github.com/repos/fchollet/keras/assignees{/user}","branches_url":"https://api.github.com/repos/fchollet/keras/branches{/branch}","tags_url":"https://api.github.com/repos/fchollet/keras/tags","blobs_url":"https://api.github.com/repos/fchollet/keras/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fchollet/keras/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fchollet/keras/git/refs{/sha}","trees_url":"https://api.github.com/repos/fchollet/keras/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fchollet/keras/statuses/{sha}","languages_url":"https://api.github.com/repos/fchollet/keras/languages","stargazers_url":"https://api.github.com/repos/fchollet/keras/stargazers","contributors_url":"https://api.github.com/repos/fchollet/keras/contributors","subscribers_url":"https://api.github.com/repos/fchollet/keras/subscribers","subscription_url":"https://api.github.com/repos/fchollet/keras/subscription","commits_url":"https://api.github.com/repos/fchollet/keras/commits{/sha}","git_commits_url":"https://api.github.com/repos/fchollet/keras/git/commits{/sha}","comments_url":"https://api.github.com/repos/fchollet/keras/comments{/number}","issue_comment_url":"https://api.github.com/repos/fchollet/keras/issues/comments{/number}","contents_url":"https://api.github.com/repos/fchollet/keras/contents/{+path}","compare_url":"https://api.github.com/repos/fchollet/keras/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fchollet/keras/merges","archive_url":"https://api.github.com/repos/fchollet/keras/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fchollet/keras/downloads","issues_url":"https://api.github.com/repos/fchollet/keras/issues{/number}","pulls_url":"https://api.github.com/repos/fchollet/keras/pulls{/number}","milestones_url":"https://api.github.com/repos/fchollet/keras/milestones{/number}","notifications_url":"https://api.github.com/repos/fchollet/keras/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fchollet/keras/labels{/name}","releases_url":"https://api.github.com/repos/fchollet/keras/releases{/id}","deployments_url":"https://api.github.com/repos/fchollet/keras/deployments","created_at":"2015-03-28T00:35:42Z","updated_at":"2016-07-08T04:31:13Z","pushed_at":"2016-07-08T07:27:24Z","git_url":"git://github.com/fchollet/keras.git","ssh_url":"git@github.com:fchollet/keras.git","clone_url":"https://github.com/fchollet/keras.git","svn_url":"https://github.com/fchollet/keras","homepage":"http://keras.io/","size":103463,"stargazers_count":6877,"watchers_count":6877,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1980,"mirror_url":null,"open_issues_count":1091,"forks":1980,"open_issues":1091,"watchers":6877,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fchollet/keras/pulls/3175"},"html":{"href":"https://github.com/fchollet/keras/pull/3175"},"issue":{"href":"https://api.github.com/repos/fchollet/keras/issues/3175"},"comments":{"href":"https://api.github.com/repos/fchollet/keras/issues/3175/comments"},"review_comments":{"href":"https://api.github.com/repos/fchollet/keras/pulls/3175/comments"},"review_comment":{"href":"https://api.github.com/repos/fchollet/keras/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fchollet/keras/pulls/3175/commits"},"statuses":{"href":"https://api.github.com/repos/fchollet/keras/statuses/bcbe7c559a48f27878f084ddeb93bb7eab7aa1a6"}}}}
{"actor":{"display_login":"MikeAmy"}}