{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/pulls/comments/102937420","pull_request_review_id":23709284,"id":102937420,"diff_hunk":"@@ -0,0 +1,338 @@\n+# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#     http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+# ==============================================================================\n+\n+\"\"\"This code implements a Feed forward neural network using TF low level APIs.\n+   It implements a binary classifier for Census Income Dataset using both single\n+   and distributed node cluster. \n+\"\"\"\n+\n+\n+import argparse\n+import json\n+import tensorflow as tf\n+import numpy as np\n+import pandas as pd\n+from tensorflow.contrib.layers.python.ops import sparse_feature_cross_op\n+from tensorflow.contrib.layers.python.ops import bucketization_op\n+\n+from StringIO import StringIO\n+\n+import model\n+import os\n+\n+tf.logging.set_verbosity(tf.logging.INFO)\n+\n+#See tutorial on wide and deep https://www.tensorflow.org/tutorials/wide_and_deep/\n+#https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/layers/python/layers/feature_column.py\n+\n+# csv columns in the input file\n+CSV_COLUMNS = ('age', 'workclass', 'fnlwgt', 'education', 'education_num',\n+               'marital_status', 'occupation', 'relationship', 'race', 'gender',\n+               'capital_gain', 'capital_loss', 'hours_per_week', 'native_country',\n+               'income_bracket')\n+\n+CATEGORICAL_COLS = ('gender', 'race', 'education', 'marital_status',\n+                    'relationship', 'workclass','occupation', 'native_country')\n+\n+CONTINUOUS_COLS = ('age', 'education_num', 'capital_gain', 'capital_loss', 'hours_per_week')\n+\n+LABEL_COL = 'income_bracket'\n+\n+\n+#\n+# Graph creation section for training and evaluation\n+#\n+def make_graph(inputs, labels, learning_rate=0.5):","path":"census/vanilla-tf/trainer/task.py","position":57,"original_position":57,"commit_id":"274a0f955562b5bbae11288c86c8a04dc9f77100","original_commit_id":"274a0f955562b5bbae11288c86c8a04dc9f77100","user":{"login":"nikhilk","id":14608,"avatar_url":"https://avatars.githubusercontent.com/u/14608?v=3","gravatar_id":"","url":"https://api.github.com/users/nikhilk","html_url":"https://github.com/nikhilk","followers_url":"https://api.github.com/users/nikhilk/followers","following_url":"https://api.github.com/users/nikhilk/following{/other_user}","gists_url":"https://api.github.com/users/nikhilk/gists{/gist_id}","starred_url":"https://api.github.com/users/nikhilk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikhilk/subscriptions","organizations_url":"https://api.github.com/users/nikhilk/orgs","repos_url":"https://api.github.com/users/nikhilk/repos","events_url":"https://api.github.com/users/nikhilk/events{/privacy}","received_events_url":"https://api.github.com/users/nikhilk/received_events","type":"User","site_admin":false},"body":"I think you need to build three graphs - training, evaluation and prediction, because they are slightly different.\r\n\r\nThe training graph should have the loss computation and optimization op.\r\nThe evaluation graph should have eval steps.\r\n\r\nThis will also affect how you do evaluation -- defining the evaluation graph, creating a new session and loading a checkpoint into the session, and then doing an eval by by running through the data once (1 epoch), and computing eval using something like streaming_accuracy. I think this will be needed if you switch over to using an input queue for eval data, rather than loading up a dataframe.","created_at":"2017-02-24T13:10:06Z","updated_at":"2017-02-24T13:45:27Z","html_url":"https://github.com/GoogleCloudPlatform/cloudml-samples/pull/18#discussion_r102937420","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/pulls/comments/102937420"},"html":{"href":"https://github.com/GoogleCloudPlatform/cloudml-samples/pull/18#discussion_r102937420"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/pulls/18","id":106229702,"html_url":"https://github.com/GoogleCloudPlatform/cloudml-samples/pull/18","diff_url":"https://github.com/GoogleCloudPlatform/cloudml-samples/pull/18.diff","patch_url":"https://github.com/GoogleCloudPlatform/cloudml-samples/pull/18.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/issues/18","number":18,"state":"open","locked":false,"title":"Vanilla tf","user":{"login":"puneith","id":8098778,"avatar_url":"https://avatars.githubusercontent.com/u/8098778?v=3","gravatar_id":"","url":"https://api.github.com/users/puneith","html_url":"https://github.com/puneith","followers_url":"https://api.github.com/users/puneith/followers","following_url":"https://api.github.com/users/puneith/following{/other_user}","gists_url":"https://api.github.com/users/puneith/gists{/gist_id}","starred_url":"https://api.github.com/users/puneith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puneith/subscriptions","organizations_url":"https://api.github.com/users/puneith/orgs","repos_url":"https://api.github.com/users/puneith/repos","events_url":"https://api.github.com/users/puneith/events{/privacy}","received_events_url":"https://api.github.com/users/puneith/received_events","type":"User","site_admin":false},"body":"@elibixby Please take a look. The code also has probably a bug in accuracy and so please take a look at the model as well. ","created_at":"2017-02-15T01:53:32Z","updated_at":"2017-02-24T13:45:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a502bfe10af581e03ec37607f278cd7f4c0c4fb1","assignee":{"login":"puneith","id":8098778,"avatar_url":"https://avatars.githubusercontent.com/u/8098778?v=3","gravatar_id":"","url":"https://api.github.com/users/puneith","html_url":"https://github.com/puneith","followers_url":"https://api.github.com/users/puneith/followers","following_url":"https://api.github.com/users/puneith/following{/other_user}","gists_url":"https://api.github.com/users/puneith/gists{/gist_id}","starred_url":"https://api.github.com/users/puneith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puneith/subscriptions","organizations_url":"https://api.github.com/users/puneith/orgs","repos_url":"https://api.github.com/users/puneith/repos","events_url":"https://api.github.com/users/puneith/events{/privacy}","received_events_url":"https://api.github.com/users/puneith/received_events","type":"User","site_admin":false},"assignees":[{"login":"puneith","id":8098778,"avatar_url":"https://avatars.githubusercontent.com/u/8098778?v=3","gravatar_id":"","url":"https://api.github.com/users/puneith","html_url":"https://github.com/puneith","followers_url":"https://api.github.com/users/puneith/followers","following_url":"https://api.github.com/users/puneith/following{/other_user}","gists_url":"https://api.github.com/users/puneith/gists{/gist_id}","starred_url":"https://api.github.com/users/puneith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puneith/subscriptions","organizations_url":"https://api.github.com/users/puneith/orgs","repos_url":"https://api.github.com/users/puneith/repos","events_url":"https://api.github.com/users/puneith/events{/privacy}","received_events_url":"https://api.github.com/users/puneith/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/pulls/18/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/pulls/18/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/issues/18/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/statuses/274a0f955562b5bbae11288c86c8a04dc9f77100","head":{"label":"puneith:vanilla_tf","ref":"vanilla_tf","sha":"274a0f955562b5bbae11288c86c8a04dc9f77100","user":{"login":"puneith","id":8098778,"avatar_url":"https://avatars.githubusercontent.com/u/8098778?v=3","gravatar_id":"","url":"https://api.github.com/users/puneith","html_url":"https://github.com/puneith","followers_url":"https://api.github.com/users/puneith/followers","following_url":"https://api.github.com/users/puneith/following{/other_user}","gists_url":"https://api.github.com/users/puneith/gists{/gist_id}","starred_url":"https://api.github.com/users/puneith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puneith/subscriptions","organizations_url":"https://api.github.com/users/puneith/orgs","repos_url":"https://api.github.com/users/puneith/repos","events_url":"https://api.github.com/users/puneith/events{/privacy}","received_events_url":"https://api.github.com/users/puneith/received_events","type":"User","site_admin":false},"repo":{"id":69588792,"name":"cloudml-samples","full_name":"puneith/cloudml-samples","owner":{"login":"puneith","id":8098778,"avatar_url":"https://avatars.githubusercontent.com/u/8098778?v=3","gravatar_id":"","url":"https://api.github.com/users/puneith","html_url":"https://github.com/puneith","followers_url":"https://api.github.com/users/puneith/followers","following_url":"https://api.github.com/users/puneith/following{/other_user}","gists_url":"https://api.github.com/users/puneith/gists{/gist_id}","starred_url":"https://api.github.com/users/puneith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puneith/subscriptions","organizations_url":"https://api.github.com/users/puneith/orgs","repos_url":"https://api.github.com/users/puneith/repos","events_url":"https://api.github.com/users/puneith/events{/privacy}","received_events_url":"https://api.github.com/users/puneith/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/puneith/cloudml-samples","description":null,"fork":true,"url":"https://api.github.com/repos/puneith/cloudml-samples","forks_url":"https://api.github.com/repos/puneith/cloudml-samples/forks","keys_url":"https://api.github.com/repos/puneith/cloudml-samples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puneith/cloudml-samples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puneith/cloudml-samples/teams","hooks_url":"https://api.github.com/repos/puneith/cloudml-samples/hooks","issue_events_url":"https://api.github.com/repos/puneith/cloudml-samples/issues/events{/number}","events_url":"https://api.github.com/repos/puneith/cloudml-samples/events","assignees_url":"https://api.github.com/repos/puneith/cloudml-samples/assignees{/user}","branches_url":"https://api.github.com/repos/puneith/cloudml-samples/branches{/branch}","tags_url":"https://api.github.com/repos/puneith/cloudml-samples/tags","blobs_url":"https://api.github.com/repos/puneith/cloudml-samples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puneith/cloudml-samples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puneith/cloudml-samples/git/refs{/sha}","trees_url":"https://api.github.com/repos/puneith/cloudml-samples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puneith/cloudml-samples/statuses/{sha}","languages_url":"https://api.github.com/repos/puneith/cloudml-samples/languages","stargazers_url":"https://api.github.com/repos/puneith/cloudml-samples/stargazers","contributors_url":"https://api.github.com/repos/puneith/cloudml-samples/contributors","subscribers_url":"https://api.github.com/repos/puneith/cloudml-samples/subscribers","subscription_url":"https://api.github.com/repos/puneith/cloudml-samples/subscription","commits_url":"https://api.github.com/repos/puneith/cloudml-samples/commits{/sha}","git_commits_url":"https://api.github.com/repos/puneith/cloudml-samples/git/commits{/sha}","comments_url":"https://api.github.com/repos/puneith/cloudml-samples/comments{/number}","issue_comment_url":"https://api.github.com/repos/puneith/cloudml-samples/issues/comments{/number}","contents_url":"https://api.github.com/repos/puneith/cloudml-samples/contents/{+path}","compare_url":"https://api.github.com/repos/puneith/cloudml-samples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puneith/cloudml-samples/merges","archive_url":"https://api.github.com/repos/puneith/cloudml-samples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puneith/cloudml-samples/downloads","issues_url":"https://api.github.com/repos/puneith/cloudml-samples/issues{/number}","pulls_url":"https://api.github.com/repos/puneith/cloudml-samples/pulls{/number}","milestones_url":"https://api.github.com/repos/puneith/cloudml-samples/milestones{/number}","notifications_url":"https://api.github.com/repos/puneith/cloudml-samples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puneith/cloudml-samples/labels{/name}","releases_url":"https://api.github.com/repos/puneith/cloudml-samples/releases{/id}","deployments_url":"https://api.github.com/repos/puneith/cloudml-samples/deployments","created_at":"2016-09-29T17:00:57Z","updated_at":"2016-09-29T17:00:58Z","pushed_at":"2017-02-24T09:41:32Z","git_url":"git://github.com/puneith/cloudml-samples.git","ssh_url":"git@github.com:puneith/cloudml-samples.git","clone_url":"https://github.com/puneith/cloudml-samples.git","svn_url":"https://github.com/puneith/cloudml-samples","homepage":null,"size":211,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"524168e3e01e67b0d27ff1cec5d34a39fe015b50","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":69576253,"name":"cloudml-samples","full_name":"GoogleCloudPlatform/cloudml-samples","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/cloudml-samples","description":"Samples for the Google Cloud Machine Learning API","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/deployments","created_at":"2016-09-29T14:36:12Z","updated_at":"2017-02-22T19:43:54Z","pushed_at":"2017-02-24T09:41:33Z","git_url":"git://github.com/GoogleCloudPlatform/cloudml-samples.git","ssh_url":"git@github.com:GoogleCloudPlatform/cloudml-samples.git","clone_url":"https://github.com/GoogleCloudPlatform/cloudml-samples.git","svn_url":"https://github.com/GoogleCloudPlatform/cloudml-samples","homepage":"https://cloud.google.com/ml/docs","size":161,"stargazers_count":86,"watchers_count":86,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":56,"mirror_url":null,"open_issues_count":10,"forks":56,"open_issues":10,"watchers":86,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/pulls/18"},"html":{"href":"https://github.com/GoogleCloudPlatform/cloudml-samples/pull/18"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/issues/18"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloudml-samples/statuses/274a0f955562b5bbae11288c86c8a04dc9f77100"}}}}
{"actor":{"display_login":"nikhilk"}}