{"action":"created","comment":{"url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/pulls/comments/212030603","pull_request_review_id":148576313,"id":212030603,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjAzMDYwMw==","diff_hunk":"@@ -0,0 +1,47 @@\n+\"\"\"\n+Linear Regression model with sparse synthetic data for MXNet\n+\"\"\"\n+\n+import time\n+import mxnet as mx\n+\n+\n+def run_benchmark(train_data, train_label, eval_data, eval_label, batch_size, epochs):\n+    train_iter = mx.io.NDArrayIter(train_data, train_label, batch_size=batch_size, shuffle=True,\n+                                   label_name='lin_reg_label', last_batch_handle='discard')\n+    eval_iter = mx.io.NDArrayIter(eval_data, eval_label, batch_size=batch_size, shuffle=False,\n+                                  label_name='lin_reg_label', last_batch_handle='discard')\n+\n+    X = mx.sym.Variable('data', stype='csr')\n+    Y = mx.symbol.Variable('lin_reg_label', stype='csr')\n+    fully_connected_layer = mx.sym.FullyConnected(data=X, name='fc1', num_hidden=10)\n+    lro = mx.sym.LinearRegressionOutput(data=fully_connected_layer, label=Y, name=\"lro\")\n+\n+    model = mx.mod.Module(\n+        symbol=lro,\n+        data_names=['data'],\n+        label_names=['lin_reg_label']\n+    )\n+\n+    start = time.time()\n+\n+    model.fit(train_iter, eval_iter,\n+              optimizer_params={'learning_rate': 0.1, 'momentum': 0.9},\n+              num_epoch=epochs,\n+              eval_metric='mse',\n+              batch_end_callback=mx.callback.Speedometer(batch_size))\n+\n+    print(\"MXNet Sparse Benchmark Results\")\n+    print(\"Batch Size\")\n+    print(batch_size)\n+    print('Total Time')\n+    print(time.time() - start)\n+\n+    metric = mx.metric.MSE()\n+    mse = model.score(eval_iter, metric)\n+    print(\"Achieved {0:.6f} validation MSE\".format(mse[0][1]))\n+    assert model.score(eval_iter, metric)[0][1] < 0.01001, \"Achieved MSE (%f) is larger than expected (0.01001)\" % \\","path":"benchmark/sparse/linear_regression/mxnet_sparse_model.py","position":43,"original_position":43,"commit_id":"6eee4d26ce456f608dd93a6587697b3e65cf0ccf","original_commit_id":"6eee4d26ce456f608dd93a6587697b3e65cf0ccf","user":{"login":"kalyc","id":8603626,"node_id":"MDQ6VXNlcjg2MDM2MjY=","avatar_url":"https://avatars3.githubusercontent.com/u/8603626?v=4","gravatar_id":"","url":"https://api.github.com/users/kalyc","html_url":"https://github.com/kalyc","followers_url":"https://api.github.com/users/kalyc/followers","following_url":"https://api.github.com/users/kalyc/following{/other_user}","gists_url":"https://api.github.com/users/kalyc/gists{/gist_id}","starred_url":"https://api.github.com/users/kalyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalyc/subscriptions","organizations_url":"https://api.github.com/users/kalyc/orgs","repos_url":"https://api.github.com/users/kalyc/repos","events_url":"https://api.github.com/users/kalyc/events{/privacy}","received_events_url":"https://api.github.com/users/kalyc/received_events","type":"User","site_admin":false},"body":"Didn't track memory usage as we just wanted to check speed of mxnet vs keras-tf on sparse tensors.","created_at":"2018-08-22T16:56:51Z","updated_at":"2018-08-22T16:56:51Z","html_url":"https://github.com/awslabs/keras-apache-mxnet/pull/157#discussion_r212030603","pull_request_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/pulls/157","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/awslabs/keras-apache-mxnet/pulls/comments/212030603"},"html":{"href":"https://github.com/awslabs/keras-apache-mxnet/pull/157#discussion_r212030603"},"pull_request":{"href":"https://api.github.com/repos/awslabs/keras-apache-mxnet/pulls/157"}},"in_reply_to_id":211830347},"pull_request":{"url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/pulls/157","id":209273292,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5MjczMjky","html_url":"https://github.com/awslabs/keras-apache-mxnet/pull/157","diff_url":"https://github.com/awslabs/keras-apache-mxnet/pull/157.diff","patch_url":"https://github.com/awslabs/keras-apache-mxnet/pull/157.patch","issue_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/issues/157","number":157,"state":"open","locked":false,"title":"Sparse benchmark ","user":{"login":"kalyc","id":8603626,"node_id":"MDQ6VXNlcjg2MDM2MjY=","avatar_url":"https://avatars3.githubusercontent.com/u/8603626?v=4","gravatar_id":"","url":"https://api.github.com/users/kalyc","html_url":"https://github.com/kalyc","followers_url":"https://api.github.com/users/kalyc/followers","following_url":"https://api.github.com/users/kalyc/following{/other_user}","gists_url":"https://api.github.com/users/kalyc/gists{/gist_id}","starred_url":"https://api.github.com/users/kalyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalyc/subscriptions","organizations_url":"https://api.github.com/users/kalyc/orgs","repos_url":"https://api.github.com/users/kalyc/repos","events_url":"https://api.github.com/users/kalyc/events{/privacy}","received_events_url":"https://api.github.com/users/kalyc/received_events","type":"User","site_admin":false},"body":"### Summary\r\nAdded primary benchmarking model for sparse with synthetic data\r\n\r\n### Related Issues\r\n* [Not supported operators in Keras-MXNet backend](https://github.com/awslabs/keras-apache-mxnet/issues/18)\r\n* [Not supported examples in Keras-MXNet backend](https://github.com/awslabs/keras-apache-mxnet/issues/79)\r\n\r\n### PR Overview\r\n\r\n- [n] This PR requires new unit tests [y/n] (make sure tests are included)\r\n- [y] This PR requires to update the documentation [y/n] (make sure the docs are up-to-date)\r\n- [y] This PR is backwards compatible [y/n]\r\n- [n] This PR changes the current API [y/n]\r\n","created_at":"2018-08-17T22:41:09Z","updated_at":"2018-08-22T16:56:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bdfb64a1c811c3e9081c3567609bd6e5776990c5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/pulls/157/commits","review_comments_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/pulls/157/comments","review_comment_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/issues/157/comments","statuses_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/statuses/6eee4d26ce456f608dd93a6587697b3e65cf0ccf","head":{"label":"kalyc:sparse-benchmark","ref":"sparse-benchmark","sha":"6eee4d26ce456f608dd93a6587697b3e65cf0ccf","user":{"login":"kalyc","id":8603626,"node_id":"MDQ6VXNlcjg2MDM2MjY=","avatar_url":"https://avatars3.githubusercontent.com/u/8603626?v=4","gravatar_id":"","url":"https://api.github.com/users/kalyc","html_url":"https://github.com/kalyc","followers_url":"https://api.github.com/users/kalyc/followers","following_url":"https://api.github.com/users/kalyc/following{/other_user}","gists_url":"https://api.github.com/users/kalyc/gists{/gist_id}","starred_url":"https://api.github.com/users/kalyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalyc/subscriptions","organizations_url":"https://api.github.com/users/kalyc/orgs","repos_url":"https://api.github.com/users/kalyc/repos","events_url":"https://api.github.com/users/kalyc/events{/privacy}","received_events_url":"https://api.github.com/users/kalyc/received_events","type":"User","site_admin":false},"repo":{"id":136516955,"node_id":"MDEwOlJlcG9zaXRvcnkxMzY1MTY5NTU=","name":"keras-apache-mxnet","full_name":"kalyc/keras-apache-mxnet","owner":{"login":"kalyc","id":8603626,"node_id":"MDQ6VXNlcjg2MDM2MjY=","avatar_url":"https://avatars3.githubusercontent.com/u/8603626?v=4","gravatar_id":"","url":"https://api.github.com/users/kalyc","html_url":"https://github.com/kalyc","followers_url":"https://api.github.com/users/kalyc/followers","following_url":"https://api.github.com/users/kalyc/following{/other_user}","gists_url":"https://api.github.com/users/kalyc/gists{/gist_id}","starred_url":"https://api.github.com/users/kalyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalyc/subscriptions","organizations_url":"https://api.github.com/users/kalyc/orgs","repos_url":"https://api.github.com/users/kalyc/repos","events_url":"https://api.github.com/users/kalyc/events{/privacy}","received_events_url":"https://api.github.com/users/kalyc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kalyc/keras-apache-mxnet","description":"Amazon Deep Learning's Keras with Apache MXNet support","fork":true,"url":"https://api.github.com/repos/kalyc/keras-apache-mxnet","forks_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/forks","keys_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/teams","hooks_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/hooks","issue_events_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/issues/events{/number}","events_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/events","assignees_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/assignees{/user}","branches_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/branches{/branch}","tags_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/tags","blobs_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/statuses/{sha}","languages_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/languages","stargazers_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/stargazers","contributors_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/contributors","subscribers_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/subscribers","subscription_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/subscription","commits_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/contents/{+path}","compare_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/merges","archive_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/downloads","issues_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/issues{/number}","pulls_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/pulls{/number}","milestones_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/milestones{/number}","notifications_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/labels{/name}","releases_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/releases{/id}","deployments_url":"https://api.github.com/repos/kalyc/keras-apache-mxnet/deployments","created_at":"2018-06-07T18:35:31Z","updated_at":"2018-06-07T18:35:35Z","pushed_at":"2018-08-21T19:01:04Z","git_url":"git://github.com/kalyc/keras-apache-mxnet.git","ssh_url":"git@github.com:kalyc/keras-apache-mxnet.git","clone_url":"https://github.com/kalyc/keras-apache-mxnet.git","svn_url":"https://github.com/kalyc/keras-apache-mxnet","homepage":"https://github.com/awslabs/keras-apache-mxnet/wiki","size":12476,"stargazers_count":0,"watchers_count":0,"language":"Python","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,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"awslabs:dev","ref":"dev","sha":"01d59d3f91ffb13d73cadc11db94a30e4b05c2f8","user":{"login":"awslabs","id":3299148,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyOTkxNDg=","avatar_url":"https://avatars0.githubusercontent.com/u/3299148?v=4","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"repo":{"id":109059493,"node_id":"MDEwOlJlcG9zaXRvcnkxMDkwNTk0OTM=","name":"keras-apache-mxnet","full_name":"awslabs/keras-apache-mxnet","owner":{"login":"awslabs","id":3299148,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyOTkxNDg=","avatar_url":"https://avatars0.githubusercontent.com/u/3299148?v=4","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/awslabs/keras-apache-mxnet","description":"Amazon Deep Learning's Keras with Apache MXNet support","fork":true,"url":"https://api.github.com/repos/awslabs/keras-apache-mxnet","forks_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/forks","keys_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/teams","hooks_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/hooks","issue_events_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/issues/events{/number}","events_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/events","assignees_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/assignees{/user}","branches_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/branches{/branch}","tags_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/tags","blobs_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/statuses/{sha}","languages_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/languages","stargazers_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/stargazers","contributors_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/contributors","subscribers_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/subscribers","subscription_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/subscription","commits_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/contents/{+path}","compare_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/merges","archive_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/downloads","issues_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/issues{/number}","pulls_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/pulls{/number}","milestones_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/milestones{/number}","notifications_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/labels{/name}","releases_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/releases{/id}","deployments_url":"https://api.github.com/repos/awslabs/keras-apache-mxnet/deployments","created_at":"2017-10-31T22:36:43Z","updated_at":"2018-08-20T23:35:07Z","pushed_at":"2018-08-21T19:01:06Z","git_url":"git://github.com/awslabs/keras-apache-mxnet.git","ssh_url":"git@github.com:awslabs/keras-apache-mxnet.git","clone_url":"https://github.com/awslabs/keras-apache-mxnet.git","svn_url":"https://github.com/awslabs/keras-apache-mxnet","homepage":"https://github.com/awslabs/keras-apache-mxnet/wiki","size":12460,"stargazers_count":145,"watchers_count":145,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"archived":false,"open_issues_count":34,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":26,"open_issues":34,"watchers":145,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/awslabs/keras-apache-mxnet/pulls/157"},"html":{"href":"https://github.com/awslabs/keras-apache-mxnet/pull/157"},"issue":{"href":"https://api.github.com/repos/awslabs/keras-apache-mxnet/issues/157"},"comments":{"href":"https://api.github.com/repos/awslabs/keras-apache-mxnet/issues/157/comments"},"review_comments":{"href":"https://api.github.com/repos/awslabs/keras-apache-mxnet/pulls/157/comments"},"review_comment":{"href":"https://api.github.com/repos/awslabs/keras-apache-mxnet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/awslabs/keras-apache-mxnet/pulls/157/commits"},"statuses":{"href":"https://api.github.com/repos/awslabs/keras-apache-mxnet/statuses/6eee4d26ce456f608dd93a6587697b3e65cf0ccf"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"kalyc"}}