{"action":"created","comment":{"url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments/196953026","pull_request_review_id":130601208,"id":196953026,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Njk1MzAyNg==","diff_hunk":"@@ -0,0 +1,167 @@\n+/*\n+ * This software is distributed under BSD 3-clause license (see LICENSE file).\n+ *\n+ * Authors: Elfarouk, Wu Lin\n+ */\n+\n+#include <shogun/optimization/StanFirstOrderSAGCostFunction.h>\n+#include <gtest/gtest.h>\n+#include \"StanStochasticMinimizers_unittest.h\"\n+#include <shogun/optimization/L2Penalty.h>\n+#include <shogun/optimization/SGDMinimizer.h>\n+#include <shogun/optimization/GradientDescendUpdater.h>\n+#include <shogun/optimization/ConstLearningRate.h>\n+#include <shogun/mathematics/eigen3.h>\n+#include <shogun/optimization/SVRGMinimizer.h>\n+#include <shogun/base/Parameter.h>\n+#include <shogun/lib/Map.h>\n+#include <shogun/optimization/StandardMomentumCorrection.h>\n+#include <shogun/optimization/AdaDeltaUpdater.h>\n+#include <shogun/optimization/AdamUpdater.h>\n+#include <shogun/optimization/NesterovMomentumCorrection.h>\n+#include <shogun/optimization/RmsPropUpdater.h>\n+#include <shogun/optimization/AdaptMomentumCorrection.h>\n+#include <shogun/optimization/L1PenaltyForTG.h>\n+#include <shogun/optimization/InverseScalingLearningRate.h>\n+#include <shogun/optimization/ElasticNetPenalty.h>\n+#include <shogun/optimization/SMIDASMinimizer.h>\n+#include <shogun/optimization/PNormMappingFunction.h>\n+using namespace shogun;\n+using namespace Eigen;\n+using namespace stan::math;\n+using std::function;\n+\n+StanVector generateParameters()\n+{\n+\tStanVector w(3, 1);\n+\tvar x1(0), x2(0), x3(0);\n+\tw(0, 0) = x1;\n+\tw(1, 0) = x2;\n+\tw(2, 0) = x3;","path":"tests/unit/optimization/StanStochasticMinimizers_unittest.cc","position":40,"original_position":40,"commit_id":"cd56095ca62e730f523989653c521518324b0d39","original_commit_id":"cd56095ca62e730f523989653c521518324b0d39","user":{"login":"FaroukY","id":14959028,"node_id":"MDQ6VXNlcjE0OTU5MDI4","avatar_url":"https://avatars1.githubusercontent.com/u/14959028?v=4","gravatar_id":"","url":"https://api.github.com/users/FaroukY","html_url":"https://github.com/FaroukY","followers_url":"https://api.github.com/users/FaroukY/followers","following_url":"https://api.github.com/users/FaroukY/following{/other_user}","gists_url":"https://api.github.com/users/FaroukY/gists{/gist_id}","starred_url":"https://api.github.com/users/FaroukY/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FaroukY/subscriptions","organizations_url":"https://api.github.com/users/FaroukY/orgs","repos_url":"https://api.github.com/users/FaroukY/repos","events_url":"https://api.github.com/users/FaroukY/events{/privacy}","received_events_url":"https://api.github.com/users/FaroukY/received_events","type":"User","site_admin":false},"body":"Hmm, well StanVector is just an alias for Eigen<var, Dynamic, 1> so I am not sure I can change the constructor unless I define a wrapper class for Eigen<var, Dynamic, 1>. ","created_at":"2018-06-20T21:46:42Z","updated_at":"2018-06-20T21:46:42Z","html_url":"https://github.com/shogun-toolbox/shogun/pull/4294#discussion_r196953026","pull_request_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/4294","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments/196953026"},"html":{"href":"https://github.com/shogun-toolbox/shogun/pull/4294#discussion_r196953026"},"pull_request":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/4294"}},"in_reply_to_id":196469565},"pull_request":{"url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/4294","id":189563847,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg5NTYzODQ3","html_url":"https://github.com/shogun-toolbox/shogun/pull/4294","diff_url":"https://github.com/shogun-toolbox/shogun/pull/4294.diff","patch_url":"https://github.com/shogun-toolbox/shogun/pull/4294.patch","issue_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues/4294","number":4294,"state":"open","locked":false,"title":"Cost functions now support Stan Math, Kept the previous classes for backward compatability. ","user":{"login":"FaroukY","id":14959028,"node_id":"MDQ6VXNlcjE0OTU5MDI4","avatar_url":"https://avatars1.githubusercontent.com/u/14959028?v=4","gravatar_id":"","url":"https://api.github.com/users/FaroukY","html_url":"https://github.com/FaroukY","followers_url":"https://api.github.com/users/FaroukY/followers","following_url":"https://api.github.com/users/FaroukY/following{/other_user}","gists_url":"https://api.github.com/users/FaroukY/gists{/gist_id}","starred_url":"https://api.github.com/users/FaroukY/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FaroukY/subscriptions","organizations_url":"https://api.github.com/users/FaroukY/orgs","repos_url":"https://api.github.com/users/FaroukY/repos","events_url":"https://api.github.com/users/FaroukY/events{/privacy}","received_events_url":"https://api.github.com/users/FaroukY/received_events","type":"User","site_admin":false},"body":"We can now write any arbitrary cost functions in Stan Math, and get the gradients with respect to all variables, regardless how complex the cost function is. This PR has the class FirstOrderSAGCostFunctionInterface which acts as an interface for building Stochastic Average Cost functions. I've also added a unit test to show how to use the class. All reference values where validated on Tensorflow. ","created_at":"2018-05-22T06:56:43Z","updated_at":"2018-06-20T21:46:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8b7b6b701b5e58e5dc9415d3bf853b94f882dda4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/4294/commits","review_comments_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/4294/comments","review_comment_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues/4294/comments","statuses_url":"https://api.github.com/repos/shogun-toolbox/shogun/statuses/cd56095ca62e730f523989653c521518324b0d39","head":{"label":"FaroukY:stan_to_cost_function","ref":"stan_to_cost_function","sha":"cd56095ca62e730f523989653c521518324b0d39","user":{"login":"FaroukY","id":14959028,"node_id":"MDQ6VXNlcjE0OTU5MDI4","avatar_url":"https://avatars1.githubusercontent.com/u/14959028?v=4","gravatar_id":"","url":"https://api.github.com/users/FaroukY","html_url":"https://github.com/FaroukY","followers_url":"https://api.github.com/users/FaroukY/followers","following_url":"https://api.github.com/users/FaroukY/following{/other_user}","gists_url":"https://api.github.com/users/FaroukY/gists{/gist_id}","starred_url":"https://api.github.com/users/FaroukY/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FaroukY/subscriptions","organizations_url":"https://api.github.com/users/FaroukY/orgs","repos_url":"https://api.github.com/users/FaroukY/repos","events_url":"https://api.github.com/users/FaroukY/events{/privacy}","received_events_url":"https://api.github.com/users/FaroukY/received_events","type":"User","site_admin":false},"repo":{"id":125087898,"node_id":"MDEwOlJlcG9zaXRvcnkxMjUwODc4OTg=","name":"shogun","full_name":"FaroukY/shogun","owner":{"login":"FaroukY","id":14959028,"node_id":"MDQ6VXNlcjE0OTU5MDI4","avatar_url":"https://avatars1.githubusercontent.com/u/14959028?v=4","gravatar_id":"","url":"https://api.github.com/users/FaroukY","html_url":"https://github.com/FaroukY","followers_url":"https://api.github.com/users/FaroukY/followers","following_url":"https://api.github.com/users/FaroukY/following{/other_user}","gists_url":"https://api.github.com/users/FaroukY/gists{/gist_id}","starred_url":"https://api.github.com/users/FaroukY/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FaroukY/subscriptions","organizations_url":"https://api.github.com/users/FaroukY/orgs","repos_url":"https://api.github.com/users/FaroukY/repos","events_url":"https://api.github.com/users/FaroukY/events{/privacy}","received_events_url":"https://api.github.com/users/FaroukY/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/FaroukY/shogun","description":"Shōgun","fork":true,"url":"https://api.github.com/repos/FaroukY/shogun","forks_url":"https://api.github.com/repos/FaroukY/shogun/forks","keys_url":"https://api.github.com/repos/FaroukY/shogun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FaroukY/shogun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FaroukY/shogun/teams","hooks_url":"https://api.github.com/repos/FaroukY/shogun/hooks","issue_events_url":"https://api.github.com/repos/FaroukY/shogun/issues/events{/number}","events_url":"https://api.github.com/repos/FaroukY/shogun/events","assignees_url":"https://api.github.com/repos/FaroukY/shogun/assignees{/user}","branches_url":"https://api.github.com/repos/FaroukY/shogun/branches{/branch}","tags_url":"https://api.github.com/repos/FaroukY/shogun/tags","blobs_url":"https://api.github.com/repos/FaroukY/shogun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FaroukY/shogun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FaroukY/shogun/git/refs{/sha}","trees_url":"https://api.github.com/repos/FaroukY/shogun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FaroukY/shogun/statuses/{sha}","languages_url":"https://api.github.com/repos/FaroukY/shogun/languages","stargazers_url":"https://api.github.com/repos/FaroukY/shogun/stargazers","contributors_url":"https://api.github.com/repos/FaroukY/shogun/contributors","subscribers_url":"https://api.github.com/repos/FaroukY/shogun/subscribers","subscription_url":"https://api.github.com/repos/FaroukY/shogun/subscription","commits_url":"https://api.github.com/repos/FaroukY/shogun/commits{/sha}","git_commits_url":"https://api.github.com/repos/FaroukY/shogun/git/commits{/sha}","comments_url":"https://api.github.com/repos/FaroukY/shogun/comments{/number}","issue_comment_url":"https://api.github.com/repos/FaroukY/shogun/issues/comments{/number}","contents_url":"https://api.github.com/repos/FaroukY/shogun/contents/{+path}","compare_url":"https://api.github.com/repos/FaroukY/shogun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FaroukY/shogun/merges","archive_url":"https://api.github.com/repos/FaroukY/shogun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FaroukY/shogun/downloads","issues_url":"https://api.github.com/repos/FaroukY/shogun/issues{/number}","pulls_url":"https://api.github.com/repos/FaroukY/shogun/pulls{/number}","milestones_url":"https://api.github.com/repos/FaroukY/shogun/milestones{/number}","notifications_url":"https://api.github.com/repos/FaroukY/shogun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FaroukY/shogun/labels{/name}","releases_url":"https://api.github.com/repos/FaroukY/shogun/releases{/id}","deployments_url":"https://api.github.com/repos/FaroukY/shogun/deployments","created_at":"2018-03-13T17:15:16Z","updated_at":"2018-06-15T09:05:59Z","pushed_at":"2018-06-17T11:29:00Z","git_url":"git://github.com/FaroukY/shogun.git","ssh_url":"git@github.com:FaroukY/shogun.git","clone_url":"https://github.com/FaroukY/shogun.git","svn_url":"https://github.com/FaroukY/shogun","homepage":"http://shogun.ml","size":65030,"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":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"shogun-toolbox:develop","ref":"develop","sha":"f14235704a0dd7c98b4569daae771378128efdd1","user":{"login":"shogun-toolbox","id":690673,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5MDY3Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/690673?v=4","gravatar_id":"","url":"https://api.github.com/users/shogun-toolbox","html_url":"https://github.com/shogun-toolbox","followers_url":"https://api.github.com/users/shogun-toolbox/followers","following_url":"https://api.github.com/users/shogun-toolbox/following{/other_user}","gists_url":"https://api.github.com/users/shogun-toolbox/gists{/gist_id}","starred_url":"https://api.github.com/users/shogun-toolbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shogun-toolbox/subscriptions","organizations_url":"https://api.github.com/users/shogun-toolbox/orgs","repos_url":"https://api.github.com/users/shogun-toolbox/repos","events_url":"https://api.github.com/users/shogun-toolbox/events{/privacy}","received_events_url":"https://api.github.com/users/shogun-toolbox/received_events","type":"Organization","site_admin":false},"repo":{"id":1555094,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU1MDk0","name":"shogun","full_name":"shogun-toolbox/shogun","owner":{"login":"shogun-toolbox","id":690673,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5MDY3Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/690673?v=4","gravatar_id":"","url":"https://api.github.com/users/shogun-toolbox","html_url":"https://github.com/shogun-toolbox","followers_url":"https://api.github.com/users/shogun-toolbox/followers","following_url":"https://api.github.com/users/shogun-toolbox/following{/other_user}","gists_url":"https://api.github.com/users/shogun-toolbox/gists{/gist_id}","starred_url":"https://api.github.com/users/shogun-toolbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shogun-toolbox/subscriptions","organizations_url":"https://api.github.com/users/shogun-toolbox/orgs","repos_url":"https://api.github.com/users/shogun-toolbox/repos","events_url":"https://api.github.com/users/shogun-toolbox/events{/privacy}","received_events_url":"https://api.github.com/users/shogun-toolbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shogun-toolbox/shogun","description":"Shōgun","fork":false,"url":"https://api.github.com/repos/shogun-toolbox/shogun","forks_url":"https://api.github.com/repos/shogun-toolbox/shogun/forks","keys_url":"https://api.github.com/repos/shogun-toolbox/shogun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shogun-toolbox/shogun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shogun-toolbox/shogun/teams","hooks_url":"https://api.github.com/repos/shogun-toolbox/shogun/hooks","issue_events_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues/events{/number}","events_url":"https://api.github.com/repos/shogun-toolbox/shogun/events","assignees_url":"https://api.github.com/repos/shogun-toolbox/shogun/assignees{/user}","branches_url":"https://api.github.com/repos/shogun-toolbox/shogun/branches{/branch}","tags_url":"https://api.github.com/repos/shogun-toolbox/shogun/tags","blobs_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/refs{/sha}","trees_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shogun-toolbox/shogun/statuses/{sha}","languages_url":"https://api.github.com/repos/shogun-toolbox/shogun/languages","stargazers_url":"https://api.github.com/repos/shogun-toolbox/shogun/stargazers","contributors_url":"https://api.github.com/repos/shogun-toolbox/shogun/contributors","subscribers_url":"https://api.github.com/repos/shogun-toolbox/shogun/subscribers","subscription_url":"https://api.github.com/repos/shogun-toolbox/shogun/subscription","commits_url":"https://api.github.com/repos/shogun-toolbox/shogun/commits{/sha}","git_commits_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/commits{/sha}","comments_url":"https://api.github.com/repos/shogun-toolbox/shogun/comments{/number}","issue_comment_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues/comments{/number}","contents_url":"https://api.github.com/repos/shogun-toolbox/shogun/contents/{+path}","compare_url":"https://api.github.com/repos/shogun-toolbox/shogun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shogun-toolbox/shogun/merges","archive_url":"https://api.github.com/repos/shogun-toolbox/shogun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shogun-toolbox/shogun/downloads","issues_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues{/number}","pulls_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls{/number}","milestones_url":"https://api.github.com/repos/shogun-toolbox/shogun/milestones{/number}","notifications_url":"https://api.github.com/repos/shogun-toolbox/shogun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shogun-toolbox/shogun/labels{/name}","releases_url":"https://api.github.com/repos/shogun-toolbox/shogun/releases{/id}","deployments_url":"https://api.github.com/repos/shogun-toolbox/shogun/deployments","created_at":"2011-04-01T10:44:32Z","updated_at":"2018-06-20T18:58:20Z","pushed_at":"2018-06-20T18:24:00Z","git_url":"git://github.com/shogun-toolbox/shogun.git","ssh_url":"git@github.com:shogun-toolbox/shogun.git","clone_url":"https://github.com/shogun-toolbox/shogun.git","svn_url":"https://github.com/shogun-toolbox/shogun","homepage":"http://shogun.ml","size":65207,"stargazers_count":2145,"watchers_count":2145,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":871,"mirror_url":null,"archived":false,"open_issues_count":531,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":871,"open_issues":531,"watchers":2145,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/4294"},"html":{"href":"https://github.com/shogun-toolbox/shogun/pull/4294"},"issue":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/issues/4294"},"comments":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/issues/4294/comments"},"review_comments":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/4294/comments"},"review_comment":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/4294/commits"},"statuses":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/statuses/cd56095ca62e730f523989653c521518324b0d39"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"FaroukY"}}