{"action":"created","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/3098","repository_url":"https://api.github.com/repos/fchollet/keras","labels_url":"https://api.github.com/repos/fchollet/keras/issues/3098/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/3098/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/3098/events","html_url":"https://github.com/fchollet/keras/pull/3098","id":162737059,"number":3098,"title":"Use binary accuracy for binary cross-entropy loss","user":{"login":"Joshua-Chin","id":5422226,"avatar_url":"https://avatars.githubusercontent.com/u/5422226?v=3","gravatar_id":"","url":"https://api.github.com/users/Joshua-Chin","html_url":"https://github.com/Joshua-Chin","followers_url":"https://api.github.com/users/Joshua-Chin/followers","following_url":"https://api.github.com/users/Joshua-Chin/following{/other_user}","gists_url":"https://api.github.com/users/Joshua-Chin/gists{/gist_id}","starred_url":"https://api.github.com/users/Joshua-Chin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joshua-Chin/subscriptions","organizations_url":"https://api.github.com/users/Joshua-Chin/orgs","repos_url":"https://api.github.com/users/Joshua-Chin/repos","events_url":"https://api.github.com/users/Joshua-Chin/events{/privacy}","received_events_url":"https://api.github.com/users/Joshua-Chin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-28T17:06:07Z","updated_at":"2016-09-29T18:39:07Z","closed_at":"2016-06-28T19:45:34Z","pull_request":{"url":"https://api.github.com/repos/fchollet/keras/pulls/3098","html_url":"https://github.com/fchollet/keras/pull/3098","diff_url":"https://github.com/fchollet/keras/pull/3098.diff","patch_url":"https://github.com/fchollet/keras/pull/3098.patch"},"body":"Currently, the model will default to categorical accuracy when the loss function is binary cross-entropy. It makes more sense to use binary accuracy instead."},"comment":{"url":"https://api.github.com/repos/fchollet/keras/issues/comments/250554265","html_url":"https://github.com/fchollet/keras/pull/3098#issuecomment-250554265","issue_url":"https://api.github.com/repos/fchollet/keras/issues/3098","id":250554265,"user":{"login":"DannyWeitekamp","id":5473220,"avatar_url":"https://avatars.githubusercontent.com/u/5473220?v=3","gravatar_id":"","url":"https://api.github.com/users/DannyWeitekamp","html_url":"https://github.com/DannyWeitekamp","followers_url":"https://api.github.com/users/DannyWeitekamp/followers","following_url":"https://api.github.com/users/DannyWeitekamp/following{/other_user}","gists_url":"https://api.github.com/users/DannyWeitekamp/gists{/gist_id}","starred_url":"https://api.github.com/users/DannyWeitekamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DannyWeitekamp/subscriptions","organizations_url":"https://api.github.com/users/DannyWeitekamp/orgs","repos_url":"https://api.github.com/users/DannyWeitekamp/repos","events_url":"https://api.github.com/users/DannyWeitekamp/events{/privacy}","received_events_url":"https://api.github.com/users/DannyWeitekamp/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T18:39:07Z","updated_at":"2016-09-29T18:39:07Z","body":"Hi this change was made in error, and has invalidated several weeks of results for my project.\r\n\r\nConsider any target with 3 elements [0,0,1] and the output [0,0,0]. Binary accuracy computes the mean incorrectly as ~(2/3).\r\n```python\r\nK = np\r\ndef binary_accuracy(y_true, y_pred):\r\n    return K.mean(K.equal(y_true, K.round(y_pred)))\r\ntrivial = [[0,0,0], [0,0,0], [0,0,0]]\r\nt = [[0,0,1], [0,1,0], [1,0,0]]\r\nbinary_accuracy(trivial, o)\r\n```\r\nOutput:`0.66666666666666663`\r\n"}}
{"actor":{"display_login":"DannyWeitekamp"}}