{"action":"opened","number":1623,"pull_request":{"url":"https://api.github.com/repos/fchollet/keras/pulls/1623","id":57988800,"html_url":"https://github.com/fchollet/keras/pull/1623","diff_url":"https://github.com/fchollet/keras/pull/1623.diff","patch_url":"https://github.com/fchollet/keras/pull/1623.patch","issue_url":"https://api.github.com/repos/fchollet/keras/issues/1623","number":1623,"state":"open","locked":false,"title":"Convolutional layers for 3D","user":{"login":"oeway","id":478667,"avatar_url":"https://avatars.githubusercontent.com/u/478667?v=3","gravatar_id":"","url":"https://api.github.com/users/oeway","html_url":"https://github.com/oeway","followers_url":"https://api.github.com/users/oeway/followers","following_url":"https://api.github.com/users/oeway/following{/other_user}","gists_url":"https://api.github.com/users/oeway/gists{/gist_id}","starred_url":"https://api.github.com/users/oeway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oeway/subscriptions","organizations_url":"https://api.github.com/users/oeway/orgs","repos_url":"https://api.github.com/users/oeway/repos","events_url":"https://api.github.com/users/oeway/events{/privacy}","received_events_url":"https://api.github.com/users/oeway/received_events","type":"User","site_admin":false},"body":"This PR includes the following convolution layers:\r\n\r\n- Convolution3D\r\n- MaxPooling3D\r\n- AveragePooling3D\r\n- UpSampling3D\r\n- ZeroPadding3D\r\n\r\nAnd also the corresponding test functions for these layers.\r\nThe following functions are added into theano_backend.py:\r\n\r\n- conv3d\r\n- pool3d\r\n- resize_volumes\r\n- spatial_3d_padding\r\n\r\nBut notice that, currently, these are not implemented in tensorflow backend, due the fact that there is no convolution3d ops are implemented in tensorflow. It would be great if anyone can implement it.\r\n\r\nDetails about convolution3d in theano:\r\n\r\n   There are two implementations available in theano, I used conv3d2d.conv3d for both GPU and CPU, because it's faster:\r\n```\r\n * on CPU:\r\n        *  conv3d2d.conv3d:    160 ms per loop\r\noutput:\r\n[  2.30778933   2.12729692  -3.06885958  -4.90572691  10.89875412\r\n   3.7447443   -4.60463953   8.3501606    3.69148254  -0.93439424]\r\n\r\n        *  nnet.Conv3D.conv3D: 1.19 s per loop\r\noutput:\r\n[  2.30778956   2.12729645  -3.0688591   -4.90572643  10.89875507\r\n   3.74474525  -4.60463953   8.35016346   3.69148254  -0.93439448]\r\n\r\n * on GPU (k40):\r\n\r\n        *  conv3d2d.conv3d:    36.2 ms per loop\r\noutput:\r\n[  2.30778933   2.12729692  -3.06885958  -4.90572691  10.89875412\r\n   3.7447443   -4.60463953   8.3501606    3.69148254  -0.93439424]\r\n\r\n       *  nnet.Conv3D.conv3D: 941 ms per loop\r\noutput:\r\n[  2.30778956   2.12729645  -3.0688591   -4.90572643  10.89875507\r\n   3.74474525  -4.60463953   8.35016346   3.69148254  -0.93439448]\r\n\r\n```\r\n\r\nNotice that there are precision differences with conv3d2d.conv3d on GPU and CPU. The testing code can be found in this discussion: https://groups.google.com/d/msg/theano-users/1S9_bZgHxVw/0cQR9a4riFUJ.\r\n\r\nAnother PR(#718) is created by @MinhazPalasara  but it's out dated. Many functions and the test examples in this PR are taken from #718, thanks @MinhazPalasara, @rbharath, @fchollet and others for improving that codes and giving suggestions.\r\n\r\nBe careful that, these codes are not tested very restrictedly, please report bugs if you encountered any.\r\n","created_at":"2016-02-02T13:49:49Z","updated_at":"2016-02-02T13:49:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fchollet/keras/pulls/1623/commits","review_comments_url":"https://api.github.com/repos/fchollet/keras/pulls/1623/comments","review_comment_url":"https://api.github.com/repos/fchollet/keras/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/1623/comments","statuses_url":"https://api.github.com/repos/fchollet/keras/statuses/eaaef50358fad328fbb9c0bba6755c7835e3f5be","head":{"label":"oeway:master","ref":"master","sha":"eaaef50358fad328fbb9c0bba6755c7835e3f5be","user":{"login":"oeway","id":478667,"avatar_url":"https://avatars.githubusercontent.com/u/478667?v=3","gravatar_id":"","url":"https://api.github.com/users/oeway","html_url":"https://github.com/oeway","followers_url":"https://api.github.com/users/oeway/followers","following_url":"https://api.github.com/users/oeway/following{/other_user}","gists_url":"https://api.github.com/users/oeway/gists{/gist_id}","starred_url":"https://api.github.com/users/oeway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oeway/subscriptions","organizations_url":"https://api.github.com/users/oeway/orgs","repos_url":"https://api.github.com/users/oeway/repos","events_url":"https://api.github.com/users/oeway/events{/privacy}","received_events_url":"https://api.github.com/users/oeway/received_events","type":"User","site_admin":false},"repo":{"id":50852294,"name":"keras","full_name":"oeway/keras","owner":{"login":"oeway","id":478667,"avatar_url":"https://avatars.githubusercontent.com/u/478667?v=3","gravatar_id":"","url":"https://api.github.com/users/oeway","html_url":"https://github.com/oeway","followers_url":"https://api.github.com/users/oeway/followers","following_url":"https://api.github.com/users/oeway/following{/other_user}","gists_url":"https://api.github.com/users/oeway/gists{/gist_id}","starred_url":"https://api.github.com/users/oeway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oeway/subscriptions","organizations_url":"https://api.github.com/users/oeway/orgs","repos_url":"https://api.github.com/users/oeway/repos","events_url":"https://api.github.com/users/oeway/events{/privacy}","received_events_url":"https://api.github.com/users/oeway/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oeway/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/oeway/keras","forks_url":"https://api.github.com/repos/oeway/keras/forks","keys_url":"https://api.github.com/repos/oeway/keras/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oeway/keras/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oeway/keras/teams","hooks_url":"https://api.github.com/repos/oeway/keras/hooks","issue_events_url":"https://api.github.com/repos/oeway/keras/issues/events{/number}","events_url":"https://api.github.com/repos/oeway/keras/events","assignees_url":"https://api.github.com/repos/oeway/keras/assignees{/user}","branches_url":"https://api.github.com/repos/oeway/keras/branches{/branch}","tags_url":"https://api.github.com/repos/oeway/keras/tags","blobs_url":"https://api.github.com/repos/oeway/keras/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oeway/keras/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oeway/keras/git/refs{/sha}","trees_url":"https://api.github.com/repos/oeway/keras/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oeway/keras/statuses/{sha}","languages_url":"https://api.github.com/repos/oeway/keras/languages","stargazers_url":"https://api.github.com/repos/oeway/keras/stargazers","contributors_url":"https://api.github.com/repos/oeway/keras/contributors","subscribers_url":"https://api.github.com/repos/oeway/keras/subscribers","subscription_url":"https://api.github.com/repos/oeway/keras/subscription","commits_url":"https://api.github.com/repos/oeway/keras/commits{/sha}","git_commits_url":"https://api.github.com/repos/oeway/keras/git/commits{/sha}","comments_url":"https://api.github.com/repos/oeway/keras/comments{/number}","issue_comment_url":"https://api.github.com/repos/oeway/keras/issues/comments{/number}","contents_url":"https://api.github.com/repos/oeway/keras/contents/{+path}","compare_url":"https://api.github.com/repos/oeway/keras/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oeway/keras/merges","archive_url":"https://api.github.com/repos/oeway/keras/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oeway/keras/downloads","issues_url":"https://api.github.com/repos/oeway/keras/issues{/number}","pulls_url":"https://api.github.com/repos/oeway/keras/pulls{/number}","milestones_url":"https://api.github.com/repos/oeway/keras/milestones{/number}","notifications_url":"https://api.github.com/repos/oeway/keras/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oeway/keras/labels{/name}","releases_url":"https://api.github.com/repos/oeway/keras/releases{/id}","deployments_url":"https://api.github.com/repos/oeway/keras/deployments","created_at":"2016-02-01T16:18:18Z","updated_at":"2016-02-01T16:18:19Z","pushed_at":"2016-02-02T13:29:59Z","git_url":"git://github.com/oeway/keras.git","ssh_url":"git@github.com:oeway/keras.git","clone_url":"https://github.com/oeway/keras.git","svn_url":"https://github.com/oeway/keras","homepage":"http://keras.io/","size":1941,"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":"095b6c118cb0b0c3bfda9c012e2dbcd5546f4afb","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-02-02T13:37:15Z","pushed_at":"2016-02-02T13:49:50Z","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":3452,"stargazers_count":4235,"watchers_count":4235,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1009,"mirror_url":null,"open_issues_count":427,"forks":1009,"open_issues":427,"watchers":4235,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fchollet/keras/pulls/1623"},"html":{"href":"https://github.com/fchollet/keras/pull/1623"},"issue":{"href":"https://api.github.com/repos/fchollet/keras/issues/1623"},"comments":{"href":"https://api.github.com/repos/fchollet/keras/issues/1623/comments"},"review_comments":{"href":"https://api.github.com/repos/fchollet/keras/pulls/1623/comments"},"review_comment":{"href":"https://api.github.com/repos/fchollet/keras/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fchollet/keras/pulls/1623/commits"},"statuses":{"href":"https://api.github.com/repos/fchollet/keras/statuses/eaaef50358fad328fbb9c0bba6755c7835e3f5be"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":5,"additions":944,"deletions":1,"changed_files":5}}