{"action":"created","issue":{"url":"https://api.github.com/repos/caicloud/tensorflow-tutorial/issues/117","repository_url":"https://api.github.com/repos/caicloud/tensorflow-tutorial","labels_url":"https://api.github.com/repos/caicloud/tensorflow-tutorial/issues/117/labels{/name}","comments_url":"https://api.github.com/repos/caicloud/tensorflow-tutorial/issues/117/comments","events_url":"https://api.github.com/repos/caicloud/tensorflow-tutorial/issues/117/events","html_url":"https://github.com/caicloud/tensorflow-tutorial/issues/117","id":334743199,"node_id":"MDU6SXNzdWUzMzQ3NDMxOTk=","number":117,"title":"第二版 第五章 5.2.1节关于计算交叉熵的问题 pp:99","user":{"login":"skx300","id":20068789,"node_id":"MDQ6VXNlcjIwMDY4Nzg5","avatar_url":"https://avatars2.githubusercontent.com/u/20068789?v=4","gravatar_id":"","url":"https://api.github.com/users/skx300","html_url":"https://github.com/skx300","followers_url":"https://api.github.com/users/skx300/followers","following_url":"https://api.github.com/users/skx300/following{/other_user}","gists_url":"https://api.github.com/users/skx300/gists{/gist_id}","starred_url":"https://api.github.com/users/skx300/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skx300/subscriptions","organizations_url":"https://api.github.com/users/skx300/orgs","repos_url":"https://api.github.com/users/skx300/repos","events_url":"https://api.github.com/users/skx300/events{/privacy}","received_events_url":"https://api.github.com/users/skx300/received_events","type":"User","site_admin":false},"labels":[{"id":809769621,"node_id":"MDU6TGFiZWw4MDk3Njk2MjE=","url":"https://api.github.com/repos/caicloud/tensorflow-tutorial/labels/lifecycle/stale","name":"lifecycle/stale","color":"795548","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-22T04:44:05Z","updated_at":"2018-10-20T05:54:00Z","closed_at":null,"author_association":"NONE","body":"我看这里计算了使用非滑动平均和滑动平均的inference。但是在计算交叉熵的时候，只用到了非滑动平均的预测值。而在评价accuracy的时候，却是用了使用滑动平均的预测值。请问这里为什么不用使用滑动平均的预测值来计算交叉熵呢？因为评价的时候就是用了使用滑动平均的预测值啊。\r\n\r\n代码片段如下：\r\n\r\n``` python\r\n    # 计算交叉熵及其平均值\r\n    cross_entropy = tf.nn.sparse_softmax_cross_entropy_with_logits(logits=y, labels=tf.argmax(y_, 1))\r\n    cross_entropy_mean = tf.reduce_mean(cross_entropy)\r\n```\r\n\r\n```python\r\n    # 计算正确率\r\n    correct_prediction = tf.equal(tf.argmax(average_y, 1), tf.argmax(y_, 1))\r\n    accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))\r\n```"},"comment":{"url":"https://api.github.com/repos/caicloud/tensorflow-tutorial/issues/comments/431552172","html_url":"https://github.com/caicloud/tensorflow-tutorial/issues/117#issuecomment-431552172","issue_url":"https://api.github.com/repos/caicloud/tensorflow-tutorial/issues/117","id":431552172,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTU1MjE3Mg==","user":{"login":"caicloud-bot","id":14260140,"node_id":"MDQ6VXNlcjE0MjYwMTQw","avatar_url":"https://avatars0.githubusercontent.com/u/14260140?v=4","gravatar_id":"","url":"https://api.github.com/users/caicloud-bot","html_url":"https://github.com/caicloud-bot","followers_url":"https://api.github.com/users/caicloud-bot/followers","following_url":"https://api.github.com/users/caicloud-bot/following{/other_user}","gists_url":"https://api.github.com/users/caicloud-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/caicloud-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caicloud-bot/subscriptions","organizations_url":"https://api.github.com/users/caicloud-bot/orgs","repos_url":"https://api.github.com/users/caicloud-bot/repos","events_url":"https://api.github.com/users/caicloud-bot/events{/privacy}","received_events_url":"https://api.github.com/users/caicloud-bot/received_events","type":"User","site_admin":false},"created_at":"2018-10-20T05:54:00Z","updated_at":"2018-10-20T05:54:00Z","author_association":"CONTRIBUTOR","body":"Stale issues rot after 30d of inactivity.\nMark the issue as fresh with `/remove-lifecycle rotten`.\nRotten issues close after an additional 30d of inactivity.\n\nIf this issue is safe to close now please do so with `/close`.\n\n/lifecycle rotten\n/remove-lifecycle stale"}}
{"actor":{"display_login":"caicloud-bot"}}