{"action":"created","comment":{"url":"https://api.github.com/repos/mlpack/mlpack/pulls/comments/170081632","pull_request_review_id":98686141,"id":170081632,"diff_hunk":"@@ -0,0 +1,173 @@\n+/**\n+ * @file bilinear_interpolation_impl.hpp\n+ * @author Kris Singh and Shikhar Jaiswal\n+ *\n+ * Implementation of the bilinear interpolation function as an individual layer.\n+ *\n+ * mlpack is free software; you may redistribute it and/or modify it under the\n+ * terms of the 3-clause BSD license. You should have received a copy of the\n+ * 3-clause BSD license along with mlpack. If not, see\n+ * http://www.opensource.org/licenses/BSD-3-Clause for more information.\n+ */\n+#ifndef MLPACK_METHODS_ANN_LAYER_BILINEAR_INTERPOLATION_IMPL_HPP\n+#define MLPACK_METHODS_ANN_LAYER_BILINEAR_INTERPOLATION_IMPL_HPP\n+\n+// In case it hasn't yet been included.\n+#include \"bilinear_interpolation.hpp\"\n+\n+namespace mlpack {\n+namespace ann /** Artificial Neural Network. */ {\n+\n+\n+template<typename InputDataType, typename OutputDataType>\n+BilinearInterpolation<InputDataType, OutputDataType>::\n+BilinearInterpolation():\n+    inRowSize(0),\n+    inColSize(0),\n+    outRowSize(0),\n+    outColSize(0),\n+    depth(0)\n+{\n+  // Nothing to do here.\n+}\n+\n+template<typename InputDataType, typename OutputDataType>\n+BilinearInterpolation<InputDataType, OutputDataType>::\n+BilinearInterpolation(\n+    const size_t inRowSize,\n+    const size_t inColSize,\n+    const size_t outRowSize,\n+    const size_t outColSize,\n+    const size_t depth):\n+    inRowSize(inRowSize),\n+    inColSize(inColSize),\n+    outRowSize(outRowSize),\n+    outColSize(outColSize),\n+    depth(depth)\n+{\n+  // Nothing to do here.\n+}\n+\n+template<typename InputDataType, typename OutputDataType>\n+template<typename eT>\n+void BilinearInterpolation<InputDataType, OutputDataType>::Forward(\n+    const arma::Mat<eT>&& input, arma::Mat<eT>&& output)\n+{\n+  if (output.is_empty())\n+    output.set_size(outRowSize * outColSize * depth, 1);\n+\n+  assert(input.n_rows == inRowSize * inColSize * depth);\n+  assert(input.n_cols == 1);\n+  assert(output.n_rows == outRowSize * outColSize * depth);\n+  assert(output.n_cols == 1);\n+  assert(inRowSize >= 2);\n+  assert(inColSize >= 2);\n+\n+  arma::cube inputAsCube(input.memptr(), inRowSize, inColSize, depth);\n+  arma::cube outputAsCube(output.memptr(), outRowSize, outColSize, depth, false, true);\n+\n+  double scaleRow = (double) inRowSize / (double) outRowSize;\n+  double scaleCol = (double) inColSize / (double) outColSize;\n+\n+  arma::mat22 coeffs;\n+  for (size_t i = 0; i < outRowSize; i++)\n+  {\n+    for (size_t j = 0; j < outColSize; j++)","path":"src/mlpack/methods/ann/layer/bilinear_interpolation_impl.hpp","position":75,"original_position":75,"commit_id":"03864a08fcb2422313f4d401cf8ceee790641505","original_commit_id":"03864a08fcb2422313f4d401cf8ceee790641505","user":{"login":"zoq","id":4209744,"avatar_url":"https://avatars3.githubusercontent.com/u/4209744?v=4","gravatar_id":"","url":"https://api.github.com/users/zoq","html_url":"https://github.com/zoq","followers_url":"https://api.github.com/users/zoq/followers","following_url":"https://api.github.com/users/zoq/following{/other_user}","gists_url":"https://api.github.com/users/zoq/gists{/gist_id}","starred_url":"https://api.github.com/users/zoq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zoq/subscriptions","organizations_url":"https://api.github.com/users/zoq/orgs","repos_url":"https://api.github.com/users/zoq/repos","events_url":"https://api.github.com/users/zoq/events{/privacy}","received_events_url":"https://api.github.com/users/zoq/received_events","type":"User","site_admin":false},"body":"I guess, this could be optimized if we would use an SIMD loop here, as done for the InformationGain caluclation here https://github.com/mlpack/mlpack/blob/88a7efe9fa87958190e6dc56dc86ec4d5ed3153a/src/mlpack/methods/decision_tree/information_gain.hpp. I don't think we have to do that in this context just a thought.","created_at":"2018-02-22T20:20:39Z","updated_at":"2018-02-22T20:24:30Z","html_url":"https://github.com/mlpack/mlpack/pull/1238#discussion_r170081632","pull_request_url":"https://api.github.com/repos/mlpack/mlpack/pulls/1238","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/comments/170081632"},"html":{"href":"https://github.com/mlpack/mlpack/pull/1238#discussion_r170081632"},"pull_request":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/1238"}}},"pull_request":{"url":"https://api.github.com/repos/mlpack/mlpack/pulls/1238","id":168481690,"html_url":"https://github.com/mlpack/mlpack/pull/1238","diff_url":"https://github.com/mlpack/mlpack/pull/1238.diff","patch_url":"https://github.com/mlpack/mlpack/pull/1238.patch","issue_url":"https://api.github.com/repos/mlpack/mlpack/issues/1238","number":1238,"state":"open","locked":false,"title":"Bilinear Interpolation Layer","user":{"login":"ShikharJ","id":19722966,"avatar_url":"https://avatars2.githubusercontent.com/u/19722966?v=4","gravatar_id":"","url":"https://api.github.com/users/ShikharJ","html_url":"https://github.com/ShikharJ","followers_url":"https://api.github.com/users/ShikharJ/followers","following_url":"https://api.github.com/users/ShikharJ/following{/other_user}","gists_url":"https://api.github.com/users/ShikharJ/gists{/gist_id}","starred_url":"https://api.github.com/users/ShikharJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShikharJ/subscriptions","organizations_url":"https://api.github.com/users/ShikharJ/orgs","repos_url":"https://api.github.com/users/ShikharJ/repos","events_url":"https://api.github.com/users/ShikharJ/events{/privacy}","received_events_url":"https://api.github.com/users/ShikharJ/received_events","type":"User","site_admin":false},"body":"Another rebase to master of the [original PR](https://github.com/mlpack/mlpack/pull/1098) by @kris-singh with the improved API and build errors removed. Required in #1204.","created_at":"2018-02-11T23:39:06Z","updated_at":"2018-02-22T20:24:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cb560e29789de64e5ea02aba15515215cc7671a3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mlpack/mlpack/pulls/1238/commits","review_comments_url":"https://api.github.com/repos/mlpack/mlpack/pulls/1238/comments","review_comment_url":"https://api.github.com/repos/mlpack/mlpack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mlpack/mlpack/issues/1238/comments","statuses_url":"https://api.github.com/repos/mlpack/mlpack/statuses/03864a08fcb2422313f4d401cf8ceee790641505","head":{"label":"ShikharJ:ResizeLayer","ref":"ResizeLayer","sha":"03864a08fcb2422313f4d401cf8ceee790641505","user":{"login":"ShikharJ","id":19722966,"avatar_url":"https://avatars2.githubusercontent.com/u/19722966?v=4","gravatar_id":"","url":"https://api.github.com/users/ShikharJ","html_url":"https://github.com/ShikharJ","followers_url":"https://api.github.com/users/ShikharJ/followers","following_url":"https://api.github.com/users/ShikharJ/following{/other_user}","gists_url":"https://api.github.com/users/ShikharJ/gists{/gist_id}","starred_url":"https://api.github.com/users/ShikharJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShikharJ/subscriptions","organizations_url":"https://api.github.com/users/ShikharJ/orgs","repos_url":"https://api.github.com/users/ShikharJ/repos","events_url":"https://api.github.com/users/ShikharJ/events{/privacy}","received_events_url":"https://api.github.com/users/ShikharJ/received_events","type":"User","site_admin":false},"repo":{"id":104371656,"name":"mlpack","full_name":"ShikharJ/mlpack","owner":{"login":"ShikharJ","id":19722966,"avatar_url":"https://avatars2.githubusercontent.com/u/19722966?v=4","gravatar_id":"","url":"https://api.github.com/users/ShikharJ","html_url":"https://github.com/ShikharJ","followers_url":"https://api.github.com/users/ShikharJ/followers","following_url":"https://api.github.com/users/ShikharJ/following{/other_user}","gists_url":"https://api.github.com/users/ShikharJ/gists{/gist_id}","starred_url":"https://api.github.com/users/ShikharJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShikharJ/subscriptions","organizations_url":"https://api.github.com/users/ShikharJ/orgs","repos_url":"https://api.github.com/users/ShikharJ/repos","events_url":"https://api.github.com/users/ShikharJ/events{/privacy}","received_events_url":"https://api.github.com/users/ShikharJ/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ShikharJ/mlpack","description":"mlpack: a scalable C++ machine learning library -- ","fork":true,"url":"https://api.github.com/repos/ShikharJ/mlpack","forks_url":"https://api.github.com/repos/ShikharJ/mlpack/forks","keys_url":"https://api.github.com/repos/ShikharJ/mlpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ShikharJ/mlpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ShikharJ/mlpack/teams","hooks_url":"https://api.github.com/repos/ShikharJ/mlpack/hooks","issue_events_url":"https://api.github.com/repos/ShikharJ/mlpack/issues/events{/number}","events_url":"https://api.github.com/repos/ShikharJ/mlpack/events","assignees_url":"https://api.github.com/repos/ShikharJ/mlpack/assignees{/user}","branches_url":"https://api.github.com/repos/ShikharJ/mlpack/branches{/branch}","tags_url":"https://api.github.com/repos/ShikharJ/mlpack/tags","blobs_url":"https://api.github.com/repos/ShikharJ/mlpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ShikharJ/mlpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ShikharJ/mlpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/ShikharJ/mlpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ShikharJ/mlpack/statuses/{sha}","languages_url":"https://api.github.com/repos/ShikharJ/mlpack/languages","stargazers_url":"https://api.github.com/repos/ShikharJ/mlpack/stargazers","contributors_url":"https://api.github.com/repos/ShikharJ/mlpack/contributors","subscribers_url":"https://api.github.com/repos/ShikharJ/mlpack/subscribers","subscription_url":"https://api.github.com/repos/ShikharJ/mlpack/subscription","commits_url":"https://api.github.com/repos/ShikharJ/mlpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/ShikharJ/mlpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/ShikharJ/mlpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/ShikharJ/mlpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/ShikharJ/mlpack/contents/{+path}","compare_url":"https://api.github.com/repos/ShikharJ/mlpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ShikharJ/mlpack/merges","archive_url":"https://api.github.com/repos/ShikharJ/mlpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ShikharJ/mlpack/downloads","issues_url":"https://api.github.com/repos/ShikharJ/mlpack/issues{/number}","pulls_url":"https://api.github.com/repos/ShikharJ/mlpack/pulls{/number}","milestones_url":"https://api.github.com/repos/ShikharJ/mlpack/milestones{/number}","notifications_url":"https://api.github.com/repos/ShikharJ/mlpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ShikharJ/mlpack/labels{/name}","releases_url":"https://api.github.com/repos/ShikharJ/mlpack/releases{/id}","deployments_url":"https://api.github.com/repos/ShikharJ/mlpack/deployments","created_at":"2017-09-21T16:22:48Z","updated_at":"2017-09-21T16:22:54Z","pushed_at":"2018-02-21T14:34:46Z","git_url":"git://github.com/ShikharJ/mlpack.git","ssh_url":"git@github.com:ShikharJ/mlpack.git","clone_url":"https://github.com/ShikharJ/mlpack.git","svn_url":"https://github.com/ShikharJ/mlpack","homepage":"http://www.mlpack.org/","size":243130,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mlpack:master","ref":"master","sha":"af3c00b164a9bc14b73e74af2fadc016ab7e9c27","user":{"login":"mlpack","id":10216045,"avatar_url":"https://avatars0.githubusercontent.com/u/10216045?v=4","gravatar_id":"","url":"https://api.github.com/users/mlpack","html_url":"https://github.com/mlpack","followers_url":"https://api.github.com/users/mlpack/followers","following_url":"https://api.github.com/users/mlpack/following{/other_user}","gists_url":"https://api.github.com/users/mlpack/gists{/gist_id}","starred_url":"https://api.github.com/users/mlpack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlpack/subscriptions","organizations_url":"https://api.github.com/users/mlpack/orgs","repos_url":"https://api.github.com/users/mlpack/repos","events_url":"https://api.github.com/users/mlpack/events{/privacy}","received_events_url":"https://api.github.com/users/mlpack/received_events","type":"Organization","site_admin":false},"repo":{"id":28149409,"name":"mlpack","full_name":"mlpack/mlpack","owner":{"login":"mlpack","id":10216045,"avatar_url":"https://avatars0.githubusercontent.com/u/10216045?v=4","gravatar_id":"","url":"https://api.github.com/users/mlpack","html_url":"https://github.com/mlpack","followers_url":"https://api.github.com/users/mlpack/followers","following_url":"https://api.github.com/users/mlpack/following{/other_user}","gists_url":"https://api.github.com/users/mlpack/gists{/gist_id}","starred_url":"https://api.github.com/users/mlpack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlpack/subscriptions","organizations_url":"https://api.github.com/users/mlpack/orgs","repos_url":"https://api.github.com/users/mlpack/repos","events_url":"https://api.github.com/users/mlpack/events{/privacy}","received_events_url":"https://api.github.com/users/mlpack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mlpack/mlpack","description":"mlpack: a scalable C++ machine learning library -- ","fork":false,"url":"https://api.github.com/repos/mlpack/mlpack","forks_url":"https://api.github.com/repos/mlpack/mlpack/forks","keys_url":"https://api.github.com/repos/mlpack/mlpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mlpack/mlpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mlpack/mlpack/teams","hooks_url":"https://api.github.com/repos/mlpack/mlpack/hooks","issue_events_url":"https://api.github.com/repos/mlpack/mlpack/issues/events{/number}","events_url":"https://api.github.com/repos/mlpack/mlpack/events","assignees_url":"https://api.github.com/repos/mlpack/mlpack/assignees{/user}","branches_url":"https://api.github.com/repos/mlpack/mlpack/branches{/branch}","tags_url":"https://api.github.com/repos/mlpack/mlpack/tags","blobs_url":"https://api.github.com/repos/mlpack/mlpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mlpack/mlpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mlpack/mlpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/mlpack/mlpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mlpack/mlpack/statuses/{sha}","languages_url":"https://api.github.com/repos/mlpack/mlpack/languages","stargazers_url":"https://api.github.com/repos/mlpack/mlpack/stargazers","contributors_url":"https://api.github.com/repos/mlpack/mlpack/contributors","subscribers_url":"https://api.github.com/repos/mlpack/mlpack/subscribers","subscription_url":"https://api.github.com/repos/mlpack/mlpack/subscription","commits_url":"https://api.github.com/repos/mlpack/mlpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/mlpack/mlpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/mlpack/mlpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/mlpack/mlpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/mlpack/mlpack/contents/{+path}","compare_url":"https://api.github.com/repos/mlpack/mlpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mlpack/mlpack/merges","archive_url":"https://api.github.com/repos/mlpack/mlpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mlpack/mlpack/downloads","issues_url":"https://api.github.com/repos/mlpack/mlpack/issues{/number}","pulls_url":"https://api.github.com/repos/mlpack/mlpack/pulls{/number}","milestones_url":"https://api.github.com/repos/mlpack/mlpack/milestones{/number}","notifications_url":"https://api.github.com/repos/mlpack/mlpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mlpack/mlpack/labels{/name}","releases_url":"https://api.github.com/repos/mlpack/mlpack/releases{/id}","deployments_url":"https://api.github.com/repos/mlpack/mlpack/deployments","created_at":"2014-12-17T18:16:59Z","updated_at":"2018-02-22T18:31:19Z","pushed_at":"2018-02-22T20:06:50Z","git_url":"git://github.com/mlpack/mlpack.git","ssh_url":"git@github.com:mlpack/mlpack.git","clone_url":"https://github.com/mlpack/mlpack.git","svn_url":"https://github.com/mlpack/mlpack","homepage":"http://www.mlpack.org/","size":242362,"stargazers_count":1980,"watchers_count":1980,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":733,"mirror_url":null,"archived":false,"open_issues_count":118,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":733,"open_issues":118,"watchers":1980,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/1238"},"html":{"href":"https://github.com/mlpack/mlpack/pull/1238"},"issue":{"href":"https://api.github.com/repos/mlpack/mlpack/issues/1238"},"comments":{"href":"https://api.github.com/repos/mlpack/mlpack/issues/1238/comments"},"review_comments":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/1238/comments"},"review_comment":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/1238/commits"},"statuses":{"href":"https://api.github.com/repos/mlpack/mlpack/statuses/03864a08fcb2422313f4d401cf8ceee790641505"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"zoq"}}