{"action":"created","comment":{"url":"https://api.github.com/repos/mlpack/mlpack/pulls/comments/174783254","pull_request_review_id":104202066,"id":174783254,"diff_hunk":"@@ -0,0 +1,100 @@\n+/**\n+ * @file nesterov_momentum_update.hpp\n+ * @author Sourabh Varshney\n+ *\n+ * Nesterov Momentum Update for Stochastic Gradient Descent.\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_CORE_OPTIMIZERS_SGD_NESTEROV_MOMENTUM_UPDATE_HPP\n+#define MLPACK_CORE_OPTIMIZERS_SGD_NESTEROV_MOMENTUM_UPDATE_HPP\n+\n+#include <mlpack/prereqs.hpp>\n+\n+namespace mlpack {\n+namespace optimization {\n+\n+/**\n+ * Nesterov Momentum update policy for Stochastic Gradient Descent (SGD).\n+ *\n+ * Learning with SGD can be slow. Applying Standard momentum can accelerate\n+ * the rate of convergence. Nesterov Momentum application can accelerate the\n+ * rate of convergence to O(1/k^2).\n+ * \n+ * @code\n+ * @techreport{Nesterov1983,\n+ *   title       = {A Method Of Solving A Convex Programming Problem With \n+ *                  Convergence Rate O(1/K^2)},\n+ *   author      = {Yuri Nesterov},\n+ *   institution = {Soviet Math. Dokl.},\n+ *   volume      = {27},\n+ *   year        = {1983},\n+ * }\n+ * @endcode\n+ */\n+class NesterovMomentumUpdate\n+{\n+ public:\n+  /**\n+   * Construct the Nesterov Momentum update policy with the given parameters.\n+   *\n+   */\n+  NesterovMomentumUpdate(const double momentum = 0.5) :\n+      momentum(momentum)\n+  {\n+    // Nothing to do.\n+  }\n+\n+  /**\n+   * The Initialize method is called by SGD Optimizer method before the start of\n+   * the iteration update process.  In the momentum update policy the velocity\n+   * matrix is initialized to the zeros matrix with the same size as the\n+   * gradient matrix (see mlpack::optimization::SGD::Optimizer )\n+   *\n+   * @param rows Number of rows in the gradient matrix.\n+   * @param cols Number of columns in the gradient matrix.\n+   */\n+  void Initialize(const size_t rows, const size_t cols)\n+  {\n+    // Initialize am empty velocity matrix.\n+    velocity = arma::zeros<arma::mat>(rows, cols);\n+  }\n+\n+  /**\n+   * Update step for SGD.  The momentum term makes the convergence faster on the\n+   * way as momentum term increases for dimensions pointing in the same and","path":"src/mlpack/core/optimizers/sgd/update_policies/nesterov_momentum_update.hpp","position":68,"original_position":68,"commit_id":"d0b6f69d9e71b3b3f812c249429fc7e69e8982c5","original_commit_id":"d0b6f69d9e71b3b3f812c249429fc7e69e8982c5","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":"`in the same direction ...` ?","created_at":"2018-03-15T13:37:26Z","updated_at":"2018-03-15T13:40:51Z","html_url":"https://github.com/mlpack/mlpack/pull/1279#discussion_r174783254","pull_request_url":"https://api.github.com/repos/mlpack/mlpack/pulls/1279","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/comments/174783254"},"html":{"href":"https://github.com/mlpack/mlpack/pull/1279#discussion_r174783254"},"pull_request":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/1279"}}},"pull_request":{"url":"https://api.github.com/repos/mlpack/mlpack/pulls/1279","id":171396590,"html_url":"https://github.com/mlpack/mlpack/pull/1279","diff_url":"https://github.com/mlpack/mlpack/pull/1279.diff","patch_url":"https://github.com/mlpack/mlpack/pull/1279.patch","issue_url":"https://api.github.com/repos/mlpack/mlpack/issues/1279","number":1279,"state":"open","locked":false,"title":"Nesterov Momentum Method","user":{"login":"sourabhvarshney111","id":25529433,"avatar_url":"https://avatars1.githubusercontent.com/u/25529433?v=4","gravatar_id":"","url":"https://api.github.com/users/sourabhvarshney111","html_url":"https://github.com/sourabhvarshney111","followers_url":"https://api.github.com/users/sourabhvarshney111/followers","following_url":"https://api.github.com/users/sourabhvarshney111/following{/other_user}","gists_url":"https://api.github.com/users/sourabhvarshney111/gists{/gist_id}","starred_url":"https://api.github.com/users/sourabhvarshney111/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourabhvarshney111/subscriptions","organizations_url":"https://api.github.com/users/sourabhvarshney111/orgs","repos_url":"https://api.github.com/users/sourabhvarshney111/repos","events_url":"https://api.github.com/users/sourabhvarshney111/events{/privacy}","received_events_url":"https://api.github.com/users/sourabhvarshney111/received_events","type":"User","site_admin":false},"body":"I have made a new PR for implementation of the method. Some more work need to be done. Would complete it correspondingly.","created_at":"2018-02-26T14:53:44Z","updated_at":"2018-03-15T13:40:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"078f6d3d6c3fda437314818ae7931bfe5ec733cc","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mlpack/mlpack/pulls/1279/commits","review_comments_url":"https://api.github.com/repos/mlpack/mlpack/pulls/1279/comments","review_comment_url":"https://api.github.com/repos/mlpack/mlpack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mlpack/mlpack/issues/1279/comments","statuses_url":"https://api.github.com/repos/mlpack/mlpack/statuses/d0b6f69d9e71b3b3f812c249429fc7e69e8982c5","head":{"label":"sourabhvarshney111:master","ref":"master","sha":"d0b6f69d9e71b3b3f812c249429fc7e69e8982c5","user":{"login":"sourabhvarshney111","id":25529433,"avatar_url":"https://avatars1.githubusercontent.com/u/25529433?v=4","gravatar_id":"","url":"https://api.github.com/users/sourabhvarshney111","html_url":"https://github.com/sourabhvarshney111","followers_url":"https://api.github.com/users/sourabhvarshney111/followers","following_url":"https://api.github.com/users/sourabhvarshney111/following{/other_user}","gists_url":"https://api.github.com/users/sourabhvarshney111/gists{/gist_id}","starred_url":"https://api.github.com/users/sourabhvarshney111/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourabhvarshney111/subscriptions","organizations_url":"https://api.github.com/users/sourabhvarshney111/orgs","repos_url":"https://api.github.com/users/sourabhvarshney111/repos","events_url":"https://api.github.com/users/sourabhvarshney111/events{/privacy}","received_events_url":"https://api.github.com/users/sourabhvarshney111/received_events","type":"User","site_admin":false},"repo":{"id":113752268,"name":"mlpack","full_name":"sourabhvarshney111/mlpack","owner":{"login":"sourabhvarshney111","id":25529433,"avatar_url":"https://avatars1.githubusercontent.com/u/25529433?v=4","gravatar_id":"","url":"https://api.github.com/users/sourabhvarshney111","html_url":"https://github.com/sourabhvarshney111","followers_url":"https://api.github.com/users/sourabhvarshney111/followers","following_url":"https://api.github.com/users/sourabhvarshney111/following{/other_user}","gists_url":"https://api.github.com/users/sourabhvarshney111/gists{/gist_id}","starred_url":"https://api.github.com/users/sourabhvarshney111/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourabhvarshney111/subscriptions","organizations_url":"https://api.github.com/users/sourabhvarshney111/orgs","repos_url":"https://api.github.com/users/sourabhvarshney111/repos","events_url":"https://api.github.com/users/sourabhvarshney111/events{/privacy}","received_events_url":"https://api.github.com/users/sourabhvarshney111/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sourabhvarshney111/mlpack","description":"mlpack: a scalable C++ machine learning library -- ","fork":true,"url":"https://api.github.com/repos/sourabhvarshney111/mlpack","forks_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/forks","keys_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/teams","hooks_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/hooks","issue_events_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/issues/events{/number}","events_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/events","assignees_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/assignees{/user}","branches_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/branches{/branch}","tags_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/tags","blobs_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/statuses/{sha}","languages_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/languages","stargazers_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/stargazers","contributors_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/contributors","subscribers_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/subscribers","subscription_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/subscription","commits_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/contents/{+path}","compare_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/merges","archive_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/downloads","issues_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/issues{/number}","pulls_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/pulls{/number}","milestones_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/milestones{/number}","notifications_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/labels{/name}","releases_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/releases{/id}","deployments_url":"https://api.github.com/repos/sourabhvarshney111/mlpack/deployments","created_at":"2017-12-10T13:29:44Z","updated_at":"2018-03-14T11:58:32Z","pushed_at":"2018-03-14T11:58:29Z","git_url":"git://github.com/sourabhvarshney111/mlpack.git","ssh_url":"git@github.com:sourabhvarshney111/mlpack.git","clone_url":"https://github.com/sourabhvarshney111/mlpack.git","svn_url":"https://github.com/sourabhvarshney111/mlpack","homepage":"http://www.mlpack.org/","size":242490,"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":"130918a5b3bf961eb1f88b251ad56035e9ad7e3c","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-03-15T13:29:07Z","pushed_at":"2018-03-15T13:28:57Z","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":242860,"stargazers_count":2032,"watchers_count":2032,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":780,"mirror_url":null,"archived":false,"open_issues_count":120,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":780,"open_issues":120,"watchers":2032,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/1279"},"html":{"href":"https://github.com/mlpack/mlpack/pull/1279"},"issue":{"href":"https://api.github.com/repos/mlpack/mlpack/issues/1279"},"comments":{"href":"https://api.github.com/repos/mlpack/mlpack/issues/1279/comments"},"review_comments":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/1279/comments"},"review_comment":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/1279/commits"},"statuses":{"href":"https://api.github.com/repos/mlpack/mlpack/statuses/d0b6f69d9e71b3b3f812c249429fc7e69e8982c5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ShikharJ"}}