{"action":"created","comment":{"url":"https://api.github.com/repos/tensorflow/models/pulls/comments/194289139","pull_request_review_id":127346193,"id":194289139,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDI4OTEzOQ==","diff_hunk":"@@ -0,0 +1,188 @@\n+\"\"\"The model makes use of concatenation of two CNN layers with different kernel sizes.\n+`sentiment_model.py` for more details about the models.\n+\"\"\"\n+from __future__ import absolute_import\n+from __future__ import division\n+from __future__ import print_function\n+\n+# pylint: disable=g-bad-import-order\n+from absl import app as absl_app\n+from absl import flags\n+import tensorflow as tf\n+# pylint: enable=g-bad-import-order\n+\n+from data import dataset\n+from data.dataset import imdb\n+import sentiment_model\n+from official.utils.flags import core as flags_core\n+from official.utils.logs import hooks_helper\n+from official.utils.logs import logger\n+\n+def evaluate_model(estimator, num_gpus):\n+  # Define prediction input function\n+  def pred_input_fn():\n+    return dataset.input_fn(\n+        FLAGS.dataset, True, per_device_batch_size(FLAGS.batch_size, num_gpus),\n+        FLAGS.vocabulary_size, FLAGS.sentence_length)\n+\n+  return estimator.evaluate(input_fn=pred_input_fn)\n+\n+def convert_keras_to_estimator(keras_model, num_gpus, model_dir=None):\n+  keras_model.compile(optimizer='rmsprop', loss=\"categorical_crossentropy\", metrics=['accuracy'])\n+\n+  if num_gpus == 0:","path":"research/sentiment_analysis/sentiment_main.py","position":33,"original_position":33,"commit_id":"cfecd7b3f3092b8b32d6df6161e01ab82f85809d","original_commit_id":"cfecd7b3f3092b8b32d6df6161e01ab82f85809d","user":{"login":"qlzh727","id":5118881,"node_id":"MDQ6VXNlcjUxMTg4ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/5118881?v=4","gravatar_id":"","url":"https://api.github.com/users/qlzh727","html_url":"https://github.com/qlzh727","followers_url":"https://api.github.com/users/qlzh727/followers","following_url":"https://api.github.com/users/qlzh727/following{/other_user}","gists_url":"https://api.github.com/users/qlzh727/gists{/gist_id}","starred_url":"https://api.github.com/users/qlzh727/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qlzh727/subscriptions","organizations_url":"https://api.github.com/users/qlzh727/orgs","repos_url":"https://api.github.com/users/qlzh727/repos","events_url":"https://api.github.com/users/qlzh727/events{/privacy}","received_events_url":"https://api.github.com/users/qlzh727/received_events","type":"User","site_admin":false},"body":"please use the util function for distributions strategy.","created_at":"2018-06-11T04:09:24Z","updated_at":"2018-06-11T04:20:00Z","html_url":"https://github.com/tensorflow/models/pull/4494#discussion_r194289139","pull_request_url":"https://api.github.com/repos/tensorflow/models/pulls/4494","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/tensorflow/models/pulls/comments/194289139"},"html":{"href":"https://github.com/tensorflow/models/pull/4494#discussion_r194289139"},"pull_request":{"href":"https://api.github.com/repos/tensorflow/models/pulls/4494"}}},"pull_request":{"url":"https://api.github.com/repos/tensorflow/models/pulls/4494","id":193745821,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNzQ1ODIx","html_url":"https://github.com/tensorflow/models/pull/4494","diff_url":"https://github.com/tensorflow/models/pull/4494.diff","patch_url":"https://github.com/tensorflow/models/pull/4494.patch","issue_url":"https://api.github.com/repos/tensorflow/models/issues/4494","number":4494,"state":"open","locked":false,"title":"Sentiment analysis model initial implementation.","user":{"login":"sculd","id":541878,"node_id":"MDQ6VXNlcjU0MTg3OA==","avatar_url":"https://avatars3.githubusercontent.com/u/541878?v=4","gravatar_id":"","url":"https://api.github.com/users/sculd","html_url":"https://github.com/sculd","followers_url":"https://api.github.com/users/sculd/followers","following_url":"https://api.github.com/users/sculd/following{/other_user}","gists_url":"https://api.github.com/users/sculd/gists{/gist_id}","starred_url":"https://api.github.com/users/sculd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sculd/subscriptions","organizations_url":"https://api.github.com/users/sculd/orgs","repos_url":"https://api.github.com/users/sculd/repos","events_url":"https://api.github.com/users/sculd/events{/privacy}","received_events_url":"https://api.github.com/users/sculd/received_events","type":"User","site_admin":false},"body":"- This is an implementation of the Sentiment Analysis model.\r\n- The implementation is with the reference to paddle version.","created_at":"2018-06-08T23:52:10Z","updated_at":"2018-06-11T04:20:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0944d6ad97d7584cb5fdccea5356f9b55fb84ff2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":337864321,"node_id":"MDU6TGFiZWwzMzc4NjQzMjE=","url":"https://api.github.com/repos/tensorflow/models/labels/cla:%20yes","name":"cla: yes","color":"009800","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/tensorflow/models/pulls/4494/commits","review_comments_url":"https://api.github.com/repos/tensorflow/models/pulls/4494/comments","review_comment_url":"https://api.github.com/repos/tensorflow/models/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tensorflow/models/issues/4494/comments","statuses_url":"https://api.github.com/repos/tensorflow/models/statuses/cfecd7b3f3092b8b32d6df6161e01ab82f85809d","head":{"label":"sculd:sentiment-analysis","ref":"sentiment-analysis","sha":"cfecd7b3f3092b8b32d6df6161e01ab82f85809d","user":{"login":"sculd","id":541878,"node_id":"MDQ6VXNlcjU0MTg3OA==","avatar_url":"https://avatars3.githubusercontent.com/u/541878?v=4","gravatar_id":"","url":"https://api.github.com/users/sculd","html_url":"https://github.com/sculd","followers_url":"https://api.github.com/users/sculd/followers","following_url":"https://api.github.com/users/sculd/following{/other_user}","gists_url":"https://api.github.com/users/sculd/gists{/gist_id}","starred_url":"https://api.github.com/users/sculd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sculd/subscriptions","organizations_url":"https://api.github.com/users/sculd/orgs","repos_url":"https://api.github.com/users/sculd/repos","events_url":"https://api.github.com/users/sculd/events{/privacy}","received_events_url":"https://api.github.com/users/sculd/received_events","type":"User","site_admin":false},"repo":{"id":136674474,"node_id":"MDEwOlJlcG9zaXRvcnkxMzY2NzQ0NzQ=","name":"models","full_name":"sculd/models","owner":{"login":"sculd","id":541878,"node_id":"MDQ6VXNlcjU0MTg3OA==","avatar_url":"https://avatars3.githubusercontent.com/u/541878?v=4","gravatar_id":"","url":"https://api.github.com/users/sculd","html_url":"https://github.com/sculd","followers_url":"https://api.github.com/users/sculd/followers","following_url":"https://api.github.com/users/sculd/following{/other_user}","gists_url":"https://api.github.com/users/sculd/gists{/gist_id}","starred_url":"https://api.github.com/users/sculd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sculd/subscriptions","organizations_url":"https://api.github.com/users/sculd/orgs","repos_url":"https://api.github.com/users/sculd/repos","events_url":"https://api.github.com/users/sculd/events{/privacy}","received_events_url":"https://api.github.com/users/sculd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sculd/models","description":"Models and examples built with TensorFlow","fork":true,"url":"https://api.github.com/repos/sculd/models","forks_url":"https://api.github.com/repos/sculd/models/forks","keys_url":"https://api.github.com/repos/sculd/models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sculd/models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sculd/models/teams","hooks_url":"https://api.github.com/repos/sculd/models/hooks","issue_events_url":"https://api.github.com/repos/sculd/models/issues/events{/number}","events_url":"https://api.github.com/repos/sculd/models/events","assignees_url":"https://api.github.com/repos/sculd/models/assignees{/user}","branches_url":"https://api.github.com/repos/sculd/models/branches{/branch}","tags_url":"https://api.github.com/repos/sculd/models/tags","blobs_url":"https://api.github.com/repos/sculd/models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sculd/models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sculd/models/git/refs{/sha}","trees_url":"https://api.github.com/repos/sculd/models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sculd/models/statuses/{sha}","languages_url":"https://api.github.com/repos/sculd/models/languages","stargazers_url":"https://api.github.com/repos/sculd/models/stargazers","contributors_url":"https://api.github.com/repos/sculd/models/contributors","subscribers_url":"https://api.github.com/repos/sculd/models/subscribers","subscription_url":"https://api.github.com/repos/sculd/models/subscription","commits_url":"https://api.github.com/repos/sculd/models/commits{/sha}","git_commits_url":"https://api.github.com/repos/sculd/models/git/commits{/sha}","comments_url":"https://api.github.com/repos/sculd/models/comments{/number}","issue_comment_url":"https://api.github.com/repos/sculd/models/issues/comments{/number}","contents_url":"https://api.github.com/repos/sculd/models/contents/{+path}","compare_url":"https://api.github.com/repos/sculd/models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sculd/models/merges","archive_url":"https://api.github.com/repos/sculd/models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sculd/models/downloads","issues_url":"https://api.github.com/repos/sculd/models/issues{/number}","pulls_url":"https://api.github.com/repos/sculd/models/pulls{/number}","milestones_url":"https://api.github.com/repos/sculd/models/milestones{/number}","notifications_url":"https://api.github.com/repos/sculd/models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sculd/models/labels{/name}","releases_url":"https://api.github.com/repos/sculd/models/releases{/id}","deployments_url":"https://api.github.com/repos/sculd/models/deployments","created_at":"2018-06-08T23:23:47Z","updated_at":"2018-06-08T23:24:00Z","pushed_at":"2018-06-08T23:47:56Z","git_url":"git://github.com/sculd/models.git","ssh_url":"git@github.com:sculd/models.git","clone_url":"https://github.com/sculd/models.git","svn_url":"https://github.com/sculd/models","homepage":"","size":481483,"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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tensorflow:master","ref":"master","sha":"9057a3a13bfea909e1b94d051e9fa47436f82f20","user":{"login":"tensorflow","id":15658638,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1NjU4NjM4","avatar_url":"https://avatars1.githubusercontent.com/u/15658638?v=4","gravatar_id":"","url":"https://api.github.com/users/tensorflow","html_url":"https://github.com/tensorflow","followers_url":"https://api.github.com/users/tensorflow/followers","following_url":"https://api.github.com/users/tensorflow/following{/other_user}","gists_url":"https://api.github.com/users/tensorflow/gists{/gist_id}","starred_url":"https://api.github.com/users/tensorflow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tensorflow/subscriptions","organizations_url":"https://api.github.com/users/tensorflow/orgs","repos_url":"https://api.github.com/users/tensorflow/repos","events_url":"https://api.github.com/users/tensorflow/events{/privacy}","received_events_url":"https://api.github.com/users/tensorflow/received_events","type":"Organization","site_admin":false},"repo":{"id":51117837,"node_id":"MDEwOlJlcG9zaXRvcnk1MTExNzgzNw==","name":"models","full_name":"tensorflow/models","owner":{"login":"tensorflow","id":15658638,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1NjU4NjM4","avatar_url":"https://avatars1.githubusercontent.com/u/15658638?v=4","gravatar_id":"","url":"https://api.github.com/users/tensorflow","html_url":"https://github.com/tensorflow","followers_url":"https://api.github.com/users/tensorflow/followers","following_url":"https://api.github.com/users/tensorflow/following{/other_user}","gists_url":"https://api.github.com/users/tensorflow/gists{/gist_id}","starred_url":"https://api.github.com/users/tensorflow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tensorflow/subscriptions","organizations_url":"https://api.github.com/users/tensorflow/orgs","repos_url":"https://api.github.com/users/tensorflow/repos","events_url":"https://api.github.com/users/tensorflow/events{/privacy}","received_events_url":"https://api.github.com/users/tensorflow/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tensorflow/models","description":"Models and examples built with TensorFlow","fork":false,"url":"https://api.github.com/repos/tensorflow/models","forks_url":"https://api.github.com/repos/tensorflow/models/forks","keys_url":"https://api.github.com/repos/tensorflow/models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tensorflow/models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tensorflow/models/teams","hooks_url":"https://api.github.com/repos/tensorflow/models/hooks","issue_events_url":"https://api.github.com/repos/tensorflow/models/issues/events{/number}","events_url":"https://api.github.com/repos/tensorflow/models/events","assignees_url":"https://api.github.com/repos/tensorflow/models/assignees{/user}","branches_url":"https://api.github.com/repos/tensorflow/models/branches{/branch}","tags_url":"https://api.github.com/repos/tensorflow/models/tags","blobs_url":"https://api.github.com/repos/tensorflow/models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tensorflow/models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tensorflow/models/git/refs{/sha}","trees_url":"https://api.github.com/repos/tensorflow/models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tensorflow/models/statuses/{sha}","languages_url":"https://api.github.com/repos/tensorflow/models/languages","stargazers_url":"https://api.github.com/repos/tensorflow/models/stargazers","contributors_url":"https://api.github.com/repos/tensorflow/models/contributors","subscribers_url":"https://api.github.com/repos/tensorflow/models/subscribers","subscription_url":"https://api.github.com/repos/tensorflow/models/subscription","commits_url":"https://api.github.com/repos/tensorflow/models/commits{/sha}","git_commits_url":"https://api.github.com/repos/tensorflow/models/git/commits{/sha}","comments_url":"https://api.github.com/repos/tensorflow/models/comments{/number}","issue_comment_url":"https://api.github.com/repos/tensorflow/models/issues/comments{/number}","contents_url":"https://api.github.com/repos/tensorflow/models/contents/{+path}","compare_url":"https://api.github.com/repos/tensorflow/models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tensorflow/models/merges","archive_url":"https://api.github.com/repos/tensorflow/models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tensorflow/models/downloads","issues_url":"https://api.github.com/repos/tensorflow/models/issues{/number}","pulls_url":"https://api.github.com/repos/tensorflow/models/pulls{/number}","milestones_url":"https://api.github.com/repos/tensorflow/models/milestones{/number}","notifications_url":"https://api.github.com/repos/tensorflow/models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tensorflow/models/labels{/name}","releases_url":"https://api.github.com/repos/tensorflow/models/releases{/id}","deployments_url":"https://api.github.com/repos/tensorflow/models/deployments","created_at":"2016-02-05T01:15:20Z","updated_at":"2018-06-11T03:50:35Z","pushed_at":"2018-06-10T18:52:27Z","git_url":"git://github.com/tensorflow/models.git","ssh_url":"git@github.com:tensorflow/models.git","clone_url":"https://github.com/tensorflow/models.git","svn_url":"https://github.com/tensorflow/models","homepage":"","size":481480,"stargazers_count":36549,"watchers_count":36549,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21168,"mirror_url":null,"archived":false,"open_issues_count":975,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":21168,"open_issues":975,"watchers":36549,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tensorflow/models/pulls/4494"},"html":{"href":"https://github.com/tensorflow/models/pull/4494"},"issue":{"href":"https://api.github.com/repos/tensorflow/models/issues/4494"},"comments":{"href":"https://api.github.com/repos/tensorflow/models/issues/4494/comments"},"review_comments":{"href":"https://api.github.com/repos/tensorflow/models/pulls/4494/comments"},"review_comment":{"href":"https://api.github.com/repos/tensorflow/models/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tensorflow/models/pulls/4494/commits"},"statuses":{"href":"https://api.github.com/repos/tensorflow/models/statuses/cfecd7b3f3092b8b32d6df6161e01ab82f85809d"}},"author_association":"NONE"}}
{"actor":{"display_login":"qlzh727"}}