{"action":"created","issue":{"url":"https://api.github.com/repos/davisking/dlib/issues/336","repository_url":"https://api.github.com/repos/davisking/dlib","labels_url":"https://api.github.com/repos/davisking/dlib/issues/336/labels{/name}","comments_url":"https://api.github.com/repos/davisking/dlib/issues/336/comments","events_url":"https://api.github.com/repos/davisking/dlib/issues/336/events","html_url":"https://github.com/davisking/dlib/pull/336","id":189770117,"number":336,"title":"Add upsampling functionality","user":{"login":"davidmascharka","id":5611862,"avatar_url":"https://avatars.githubusercontent.com/u/5611862?v=3","gravatar_id":"","url":"https://api.github.com/users/davidmascharka","html_url":"https://github.com/davidmascharka","followers_url":"https://api.github.com/users/davidmascharka/followers","following_url":"https://api.github.com/users/davidmascharka/following{/other_user}","gists_url":"https://api.github.com/users/davidmascharka/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmascharka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmascharka/subscriptions","organizations_url":"https://api.github.com/users/davidmascharka/orgs","repos_url":"https://api.github.com/users/davidmascharka/repos","events_url":"https://api.github.com/users/davidmascharka/events{/privacy}","received_events_url":"https://api.github.com/users/davidmascharka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-16T16:56:35Z","updated_at":"2016-11-16T20:43:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/davisking/dlib/pulls/336","html_url":"https://github.com/davisking/dlib/pull/336","diff_url":"https://github.com/davisking/dlib/pull/336.diff","patch_url":"https://github.com/davisking/dlib/pull/336.patch"},"body":"Addresses half of Issue #288. I copied the `pooling` class to base this on and modified that. \r\n\r\nA couple considerations: \r\n- I'm not qualified to provide a GPU implementation, so that's not currently an option. What is the best way to handle this?\r\n- I copied the idea behind the pooling class' `does_max_pooling` to allow easy modifications to add other upsampling techniques. I plan to add a \"sparse\" upsampling where the index of the max-pool value is set to the correct input value as in SegNet. This looks a little odd right now, but that was my motivation behind leaving it there.\r\n\r\nVery small example using the class:\r\n\r\n```\r\n#include <dlib/dnn.h>\r\n#include <iostream>\r\n\r\nusing namespace std;\r\nusing namespace dlib;\r\n\r\nint main(int argc, char** argv) try\r\n{\r\n    matrix<float,2,2> sample_data;\r\n    sample_data = 1.0, 2.0,\r\n                  3.0, 4.0;\r\n    block_upsample<2,3,input<matrix<float>>> upsample_tester;\r\n    cout << sample_data << endl;\r\n    cout << mat(upsample_tester(sample_data), 4, 6);\r\n}\r\ncatch(std::exception& e)\r\n{\r\n    cout << e.what() << endl;\r\n}\r\n```\r\n\r\nRunning this should give the output:\r\n\r\n```\r\n1 2\r\n3 4\r\n\r\n1 1 1 2 2 2\r\n1 1 1 2 2 2\r\n3 3 3 4 4 4\r\n3 3 3 4 4 4\r\n```"},"comment":{"url":"https://api.github.com/repos/davisking/dlib/issues/comments/261065822","html_url":"https://github.com/davisking/dlib/pull/336#issuecomment-261065822","issue_url":"https://api.github.com/repos/davisking/dlib/issues/336","id":261065822,"user":{"login":"davisking","id":6259399,"avatar_url":"https://avatars.githubusercontent.com/u/6259399?v=3","gravatar_id":"","url":"https://api.github.com/users/davisking","html_url":"https://github.com/davisking","followers_url":"https://api.github.com/users/davisking/followers","following_url":"https://api.github.com/users/davisking/following{/other_user}","gists_url":"https://api.github.com/users/davisking/gists{/gist_id}","starred_url":"https://api.github.com/users/davisking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davisking/subscriptions","organizations_url":"https://api.github.com/users/davisking/orgs","repos_url":"https://api.github.com/users/davisking/repos","events_url":"https://api.github.com/users/davisking/events{/privacy}","received_events_url":"https://api.github.com/users/davisking/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T20:43:27Z","updated_at":"2016-11-16T20:43:27Z","body":"It looked like none of your code required a user defined copy constructor.\n"}}
{"actor":{"display_login":"davisking"}}