{"action":"created","comment":{"url":"https://api.github.com/repos/pytorch/ignite/pulls/comments/221129402","pull_request_review_id":159705174,"id":221129402,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTEyOTQwMg==","diff_hunk":"@@ -0,0 +1,45 @@\n+from __future__ import division\n+\n+import torch\n+\n+from ignite.metrics.metric import Metric\n+from ignite.exceptions import NotComputableError\n+\n+\n+class Accuracy(Metric):\n+    \"\"\"\n+    Calculates the accuracy.\n+\n+    - `update` must receive output of the form `(y_pred, y)`.\n+    - `y_pred` must be in the following shape (batch_size, num_categories, ...)","path":"ignite/metrics/accuracy.py","position":14,"original_position":14,"commit_id":"8b5955dc5a5f09eb0c87751b6b71eac8d0a2310f","original_commit_id":"8b5955dc5a5f09eb0c87751b6b71eac8d0a2310f","user":{"login":"anmolsjoshi","id":17307490,"node_id":"MDQ6VXNlcjE3MzA3NDkw","avatar_url":"https://avatars1.githubusercontent.com/u/17307490?v=4","gravatar_id":"","url":"https://api.github.com/users/anmolsjoshi","html_url":"https://github.com/anmolsjoshi","followers_url":"https://api.github.com/users/anmolsjoshi/followers","following_url":"https://api.github.com/users/anmolsjoshi/following{/other_user}","gists_url":"https://api.github.com/users/anmolsjoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/anmolsjoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anmolsjoshi/subscriptions","organizations_url":"https://api.github.com/users/anmolsjoshi/orgs","repos_url":"https://api.github.com/users/anmolsjoshi/repos","events_url":"https://api.github.com/users/anmolsjoshi/events{/privacy}","received_events_url":"https://api.github.com/users/anmolsjoshi/received_events","type":"User","site_admin":false},"body":"resolved. let me know if that works. ","created_at":"2018-09-28T02:46:21Z","updated_at":"2018-09-28T02:46:21Z","html_url":"https://github.com/pytorch/ignite/pull/275#discussion_r221129402","pull_request_url":"https://api.github.com/repos/pytorch/ignite/pulls/275","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/pytorch/ignite/pulls/comments/221129402"},"html":{"href":"https://github.com/pytorch/ignite/pull/275#discussion_r221129402"},"pull_request":{"href":"https://api.github.com/repos/pytorch/ignite/pulls/275"}},"in_reply_to_id":220078806},"pull_request":{"url":"https://api.github.com/repos/pytorch/ignite/pulls/275","id":217867572,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3ODY3NTcy","html_url":"https://github.com/pytorch/ignite/pull/275","diff_url":"https://github.com/pytorch/ignite/pull/275.diff","patch_url":"https://github.com/pytorch/ignite/pull/275.patch","issue_url":"https://api.github.com/repos/pytorch/ignite/issues/275","number":275,"state":"open","locked":false,"title":"Update Precision, Recall, add Accuracy (Binary and Categorical combined)","user":{"login":"anmolsjoshi","id":17307490,"node_id":"MDQ6VXNlcjE3MzA3NDkw","avatar_url":"https://avatars1.githubusercontent.com/u/17307490?v=4","gravatar_id":"","url":"https://api.github.com/users/anmolsjoshi","html_url":"https://github.com/anmolsjoshi","followers_url":"https://api.github.com/users/anmolsjoshi/followers","following_url":"https://api.github.com/users/anmolsjoshi/following{/other_user}","gists_url":"https://api.github.com/users/anmolsjoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/anmolsjoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anmolsjoshi/subscriptions","organizations_url":"https://api.github.com/users/anmolsjoshi/orgs","repos_url":"https://api.github.com/users/anmolsjoshi/repos","events_url":"https://api.github.com/users/anmolsjoshi/events{/privacy}","received_events_url":"https://api.github.com/users/anmolsjoshi/received_events","type":"User","site_admin":false},"body":"Fixes #262 \r\n\r\nDescription:\r\nThis PR updates Precision and Recall, and adds Accuracy to handle binary and categorical cases for different types of input. \r\n\r\nCheck list:\r\n* [x] New tests are added. \r\n* [x] Updated doc string RST format\r\n* [x] Edited metrics.rst to add information about Accuracy. ","created_at":"2018-09-25T06:26:46Z","updated_at":"2018-09-28T02:46:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3d0ea19a48f4d7664ef692ab148b3153ff5060e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pytorch/ignite/pulls/275/commits","review_comments_url":"https://api.github.com/repos/pytorch/ignite/pulls/275/comments","review_comment_url":"https://api.github.com/repos/pytorch/ignite/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pytorch/ignite/issues/275/comments","statuses_url":"https://api.github.com/repos/pytorch/ignite/statuses/8b5955dc5a5f09eb0c87751b6b71eac8d0a2310f","head":{"label":"anmolsjoshi:updatemetrics","ref":"updatemetrics","sha":"8b5955dc5a5f09eb0c87751b6b71eac8d0a2310f","user":{"login":"anmolsjoshi","id":17307490,"node_id":"MDQ6VXNlcjE3MzA3NDkw","avatar_url":"https://avatars1.githubusercontent.com/u/17307490?v=4","gravatar_id":"","url":"https://api.github.com/users/anmolsjoshi","html_url":"https://github.com/anmolsjoshi","followers_url":"https://api.github.com/users/anmolsjoshi/followers","following_url":"https://api.github.com/users/anmolsjoshi/following{/other_user}","gists_url":"https://api.github.com/users/anmolsjoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/anmolsjoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anmolsjoshi/subscriptions","organizations_url":"https://api.github.com/users/anmolsjoshi/orgs","repos_url":"https://api.github.com/users/anmolsjoshi/repos","events_url":"https://api.github.com/users/anmolsjoshi/events{/privacy}","received_events_url":"https://api.github.com/users/anmolsjoshi/received_events","type":"User","site_admin":false},"repo":{"id":145067523,"node_id":"MDEwOlJlcG9zaXRvcnkxNDUwNjc1MjM=","name":"ignite","full_name":"anmolsjoshi/ignite","private":false,"owner":{"login":"anmolsjoshi","id":17307490,"node_id":"MDQ6VXNlcjE3MzA3NDkw","avatar_url":"https://avatars1.githubusercontent.com/u/17307490?v=4","gravatar_id":"","url":"https://api.github.com/users/anmolsjoshi","html_url":"https://github.com/anmolsjoshi","followers_url":"https://api.github.com/users/anmolsjoshi/followers","following_url":"https://api.github.com/users/anmolsjoshi/following{/other_user}","gists_url":"https://api.github.com/users/anmolsjoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/anmolsjoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anmolsjoshi/subscriptions","organizations_url":"https://api.github.com/users/anmolsjoshi/orgs","repos_url":"https://api.github.com/users/anmolsjoshi/repos","events_url":"https://api.github.com/users/anmolsjoshi/events{/privacy}","received_events_url":"https://api.github.com/users/anmolsjoshi/received_events","type":"User","site_admin":false},"html_url":"https://github.com/anmolsjoshi/ignite","description":"High-level library to help with training neural networks in PyTorch","fork":true,"url":"https://api.github.com/repos/anmolsjoshi/ignite","forks_url":"https://api.github.com/repos/anmolsjoshi/ignite/forks","keys_url":"https://api.github.com/repos/anmolsjoshi/ignite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anmolsjoshi/ignite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anmolsjoshi/ignite/teams","hooks_url":"https://api.github.com/repos/anmolsjoshi/ignite/hooks","issue_events_url":"https://api.github.com/repos/anmolsjoshi/ignite/issues/events{/number}","events_url":"https://api.github.com/repos/anmolsjoshi/ignite/events","assignees_url":"https://api.github.com/repos/anmolsjoshi/ignite/assignees{/user}","branches_url":"https://api.github.com/repos/anmolsjoshi/ignite/branches{/branch}","tags_url":"https://api.github.com/repos/anmolsjoshi/ignite/tags","blobs_url":"https://api.github.com/repos/anmolsjoshi/ignite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anmolsjoshi/ignite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anmolsjoshi/ignite/git/refs{/sha}","trees_url":"https://api.github.com/repos/anmolsjoshi/ignite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anmolsjoshi/ignite/statuses/{sha}","languages_url":"https://api.github.com/repos/anmolsjoshi/ignite/languages","stargazers_url":"https://api.github.com/repos/anmolsjoshi/ignite/stargazers","contributors_url":"https://api.github.com/repos/anmolsjoshi/ignite/contributors","subscribers_url":"https://api.github.com/repos/anmolsjoshi/ignite/subscribers","subscription_url":"https://api.github.com/repos/anmolsjoshi/ignite/subscription","commits_url":"https://api.github.com/repos/anmolsjoshi/ignite/commits{/sha}","git_commits_url":"https://api.github.com/repos/anmolsjoshi/ignite/git/commits{/sha}","comments_url":"https://api.github.com/repos/anmolsjoshi/ignite/comments{/number}","issue_comment_url":"https://api.github.com/repos/anmolsjoshi/ignite/issues/comments{/number}","contents_url":"https://api.github.com/repos/anmolsjoshi/ignite/contents/{+path}","compare_url":"https://api.github.com/repos/anmolsjoshi/ignite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anmolsjoshi/ignite/merges","archive_url":"https://api.github.com/repos/anmolsjoshi/ignite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anmolsjoshi/ignite/downloads","issues_url":"https://api.github.com/repos/anmolsjoshi/ignite/issues{/number}","pulls_url":"https://api.github.com/repos/anmolsjoshi/ignite/pulls{/number}","milestones_url":"https://api.github.com/repos/anmolsjoshi/ignite/milestones{/number}","notifications_url":"https://api.github.com/repos/anmolsjoshi/ignite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anmolsjoshi/ignite/labels{/name}","releases_url":"https://api.github.com/repos/anmolsjoshi/ignite/releases{/id}","deployments_url":"https://api.github.com/repos/anmolsjoshi/ignite/deployments","created_at":"2018-08-17T03:31:32Z","updated_at":"2018-09-21T01:33:26Z","pushed_at":"2018-09-25T06:21:50Z","git_url":"git://github.com/anmolsjoshi/ignite.git","ssh_url":"git@github.com:anmolsjoshi/ignite.git","clone_url":"https://github.com/anmolsjoshi/ignite.git","svn_url":"https://github.com/anmolsjoshi/ignite","homepage":"https://pytorch.org/ignite","size":27214,"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":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pytorch:master","ref":"master","sha":"a437a814fa72c7b861fce6004a0c2008c3a02681","user":{"login":"pytorch","id":21003710,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDAzNzEw","avatar_url":"https://avatars3.githubusercontent.com/u/21003710?v=4","gravatar_id":"","url":"https://api.github.com/users/pytorch","html_url":"https://github.com/pytorch","followers_url":"https://api.github.com/users/pytorch/followers","following_url":"https://api.github.com/users/pytorch/following{/other_user}","gists_url":"https://api.github.com/users/pytorch/gists{/gist_id}","starred_url":"https://api.github.com/users/pytorch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytorch/subscriptions","organizations_url":"https://api.github.com/users/pytorch/orgs","repos_url":"https://api.github.com/users/pytorch/repos","events_url":"https://api.github.com/users/pytorch/events{/privacy}","received_events_url":"https://api.github.com/users/pytorch/received_events","type":"Organization","site_admin":false},"repo":{"id":111835796,"node_id":"MDEwOlJlcG9zaXRvcnkxMTE4MzU3OTY=","name":"ignite","full_name":"pytorch/ignite","private":false,"owner":{"login":"pytorch","id":21003710,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDAzNzEw","avatar_url":"https://avatars3.githubusercontent.com/u/21003710?v=4","gravatar_id":"","url":"https://api.github.com/users/pytorch","html_url":"https://github.com/pytorch","followers_url":"https://api.github.com/users/pytorch/followers","following_url":"https://api.github.com/users/pytorch/following{/other_user}","gists_url":"https://api.github.com/users/pytorch/gists{/gist_id}","starred_url":"https://api.github.com/users/pytorch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytorch/subscriptions","organizations_url":"https://api.github.com/users/pytorch/orgs","repos_url":"https://api.github.com/users/pytorch/repos","events_url":"https://api.github.com/users/pytorch/events{/privacy}","received_events_url":"https://api.github.com/users/pytorch/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pytorch/ignite","description":"High-level library to help with training neural networks in PyTorch","fork":false,"url":"https://api.github.com/repos/pytorch/ignite","forks_url":"https://api.github.com/repos/pytorch/ignite/forks","keys_url":"https://api.github.com/repos/pytorch/ignite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pytorch/ignite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pytorch/ignite/teams","hooks_url":"https://api.github.com/repos/pytorch/ignite/hooks","issue_events_url":"https://api.github.com/repos/pytorch/ignite/issues/events{/number}","events_url":"https://api.github.com/repos/pytorch/ignite/events","assignees_url":"https://api.github.com/repos/pytorch/ignite/assignees{/user}","branches_url":"https://api.github.com/repos/pytorch/ignite/branches{/branch}","tags_url":"https://api.github.com/repos/pytorch/ignite/tags","blobs_url":"https://api.github.com/repos/pytorch/ignite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pytorch/ignite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pytorch/ignite/git/refs{/sha}","trees_url":"https://api.github.com/repos/pytorch/ignite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pytorch/ignite/statuses/{sha}","languages_url":"https://api.github.com/repos/pytorch/ignite/languages","stargazers_url":"https://api.github.com/repos/pytorch/ignite/stargazers","contributors_url":"https://api.github.com/repos/pytorch/ignite/contributors","subscribers_url":"https://api.github.com/repos/pytorch/ignite/subscribers","subscription_url":"https://api.github.com/repos/pytorch/ignite/subscription","commits_url":"https://api.github.com/repos/pytorch/ignite/commits{/sha}","git_commits_url":"https://api.github.com/repos/pytorch/ignite/git/commits{/sha}","comments_url":"https://api.github.com/repos/pytorch/ignite/comments{/number}","issue_comment_url":"https://api.github.com/repos/pytorch/ignite/issues/comments{/number}","contents_url":"https://api.github.com/repos/pytorch/ignite/contents/{+path}","compare_url":"https://api.github.com/repos/pytorch/ignite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pytorch/ignite/merges","archive_url":"https://api.github.com/repos/pytorch/ignite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pytorch/ignite/downloads","issues_url":"https://api.github.com/repos/pytorch/ignite/issues{/number}","pulls_url":"https://api.github.com/repos/pytorch/ignite/pulls{/number}","milestones_url":"https://api.github.com/repos/pytorch/ignite/milestones{/number}","notifications_url":"https://api.github.com/repos/pytorch/ignite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pytorch/ignite/labels{/name}","releases_url":"https://api.github.com/repos/pytorch/ignite/releases{/id}","deployments_url":"https://api.github.com/repos/pytorch/ignite/deployments","created_at":"2017-11-23T17:31:21Z","updated_at":"2018-09-28T02:11:17Z","pushed_at":"2018-09-25T18:56:03Z","git_url":"git://github.com/pytorch/ignite.git","ssh_url":"git@github.com:pytorch/ignite.git","clone_url":"https://github.com/pytorch/ignite.git","svn_url":"https://github.com/pytorch/ignite","homepage":"https://pytorch.org/ignite","size":2339,"stargazers_count":770,"watchers_count":770,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":82,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":82,"open_issues":21,"watchers":770,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pytorch/ignite/pulls/275"},"html":{"href":"https://github.com/pytorch/ignite/pull/275"},"issue":{"href":"https://api.github.com/repos/pytorch/ignite/issues/275"},"comments":{"href":"https://api.github.com/repos/pytorch/ignite/issues/275/comments"},"review_comments":{"href":"https://api.github.com/repos/pytorch/ignite/pulls/275/comments"},"review_comment":{"href":"https://api.github.com/repos/pytorch/ignite/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pytorch/ignite/pulls/275/commits"},"statuses":{"href":"https://api.github.com/repos/pytorch/ignite/statuses/8b5955dc5a5f09eb0c87751b6b71eac8d0a2310f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"anmolsjoshi"}}