{"action":"created","comment":{"url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/pulls/comments/189152364","pull_request_review_id":121276877,"id":189152364,"diff_hunk":"@@ -45,12 +45,19 @@ def get_input_features(self, mol):\n         atom_array = construct_atomic_number_array(mol, out_size=self.out_size)\n         adj_array = construct_adj_matrix(mol, out_size=self.out_size)\n \n-        # adjust adjacent matrix\n+        num_atoms = mol.GetNumAtoms()\n         degree_vec = numpy.sum(adj_array, axis=1)\n-        degree_sqrt_inv = 1. / numpy.sqrt(degree_vec)\n+\n+        # Add self-connections to avoid having NaN values in the matrix.\n+        degree_sqrt_inv = numpy.zeros(degree_vec.shape)\n+        mask = degree_vec > 0\n+        degree_sqrt_inv[mask] = 1. / numpy.sqrt(degree_vec[mask])\n+\n+        # Adjust the adjacency matrix.\n         adj_array *= numpy.broadcast_to(degree_sqrt_inv[:, None],\n                                         adj_array.shape)\n         adj_array *= numpy.broadcast_to(degree_sqrt_inv[None, :],\n                                         adj_array.shape)\n+        numpy.fill_diagonal(adj_array[num_atoms:, num_atoms:], 1)","path":"chainer_chemistry/dataset/preprocessors/rsgcn_preprocessor.py","position":19,"original_position":19,"commit_id":"3af441bfdcc7e25f7ea2dcc58f9865ba26226d2d","original_commit_id":"3af441bfdcc7e25f7ea2dcc58f9865ba26226d2d","user":{"login":"corochann","id":4609798,"avatar_url":"https://avatars2.githubusercontent.com/u/4609798?v=4","gravatar_id":"","url":"https://api.github.com/users/corochann","html_url":"https://github.com/corochann","followers_url":"https://api.github.com/users/corochann/followers","following_url":"https://api.github.com/users/corochann/following{/other_user}","gists_url":"https://api.github.com/users/corochann/gists{/gist_id}","starred_url":"https://api.github.com/users/corochann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corochann/subscriptions","organizations_url":"https://api.github.com/users/corochann/orgs","repos_url":"https://api.github.com/users/corochann/repos","events_url":"https://api.github.com/users/corochann/events{/privacy}","received_events_url":"https://api.github.com/users/corochann/received_events","type":"User","site_admin":false},"body":"I think this will change the model performance. so please remove this line.","created_at":"2018-05-18T02:53:30Z","updated_at":"2018-05-18T02:53:35Z","html_url":"https://github.com/pfnet-research/chainer-chemistry/pull/169#discussion_r189152364","pull_request_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/pulls/169","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/pfnet-research/chainer-chemistry/pulls/comments/189152364"},"html":{"href":"https://github.com/pfnet-research/chainer-chemistry/pull/169#discussion_r189152364"},"pull_request":{"href":"https://api.github.com/repos/pfnet-research/chainer-chemistry/pulls/169"}}},"pull_request":{"url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/pulls/169","id":187393521,"html_url":"https://github.com/pfnet-research/chainer-chemistry/pull/169","diff_url":"https://github.com/pfnet-research/chainer-chemistry/pull/169.diff","patch_url":"https://github.com/pfnet-research/chainer-chemistry/pull/169.patch","issue_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/issues/169","number":169,"state":"open","locked":false,"title":"NaN values in the adjacency matrix","user":{"login":"mihaimorariu","id":1044197,"avatar_url":"https://avatars1.githubusercontent.com/u/1044197?v=4","gravatar_id":"","url":"https://api.github.com/users/mihaimorariu","html_url":"https://github.com/mihaimorariu","followers_url":"https://api.github.com/users/mihaimorariu/followers","following_url":"https://api.github.com/users/mihaimorariu/following{/other_user}","gists_url":"https://api.github.com/users/mihaimorariu/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaimorariu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaimorariu/subscriptions","organizations_url":"https://api.github.com/users/mihaimorariu/orgs","repos_url":"https://api.github.com/users/mihaimorariu/repos","events_url":"https://api.github.com/users/mihaimorariu/events{/privacy}","received_events_url":"https://api.github.com/users/mihaimorariu/received_events","type":"User","site_admin":false},"body":"This PR fixes #166 and should be merged after #164.","created_at":"2018-05-11T08:00:58Z","updated_at":"2018-05-18T02:53:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c5d9cf433a29da5e22c4c0c08ac81377f0fd303a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/pulls/169/commits","review_comments_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/pulls/169/comments","review_comment_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/issues/169/comments","statuses_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/statuses/3af441bfdcc7e25f7ea2dcc58f9865ba26226d2d","head":{"label":"mihaimorariu:bug/nan_adjacency_matrix","ref":"bug/nan_adjacency_matrix","sha":"3af441bfdcc7e25f7ea2dcc58f9865ba26226d2d","user":{"login":"mihaimorariu","id":1044197,"avatar_url":"https://avatars1.githubusercontent.com/u/1044197?v=4","gravatar_id":"","url":"https://api.github.com/users/mihaimorariu","html_url":"https://github.com/mihaimorariu","followers_url":"https://api.github.com/users/mihaimorariu/followers","following_url":"https://api.github.com/users/mihaimorariu/following{/other_user}","gists_url":"https://api.github.com/users/mihaimorariu/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaimorariu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaimorariu/subscriptions","organizations_url":"https://api.github.com/users/mihaimorariu/orgs","repos_url":"https://api.github.com/users/mihaimorariu/repos","events_url":"https://api.github.com/users/mihaimorariu/events{/privacy}","received_events_url":"https://api.github.com/users/mihaimorariu/received_events","type":"User","site_admin":false},"repo":{"id":129327087,"name":"chainer-chemistry","full_name":"mihaimorariu/chainer-chemistry","owner":{"login":"mihaimorariu","id":1044197,"avatar_url":"https://avatars1.githubusercontent.com/u/1044197?v=4","gravatar_id":"","url":"https://api.github.com/users/mihaimorariu","html_url":"https://github.com/mihaimorariu","followers_url":"https://api.github.com/users/mihaimorariu/followers","following_url":"https://api.github.com/users/mihaimorariu/following{/other_user}","gists_url":"https://api.github.com/users/mihaimorariu/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaimorariu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaimorariu/subscriptions","organizations_url":"https://api.github.com/users/mihaimorariu/orgs","repos_url":"https://api.github.com/users/mihaimorariu/repos","events_url":"https://api.github.com/users/mihaimorariu/events{/privacy}","received_events_url":"https://api.github.com/users/mihaimorariu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mihaimorariu/chainer-chemistry","description":"Chainer Chemistry: A Library for Deep Learning in Biology and Chemistry","fork":true,"url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry","forks_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/forks","keys_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/teams","hooks_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/hooks","issue_events_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/issues/events{/number}","events_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/events","assignees_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/assignees{/user}","branches_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/branches{/branch}","tags_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/tags","blobs_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/git/refs{/sha}","trees_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/statuses/{sha}","languages_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/languages","stargazers_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/stargazers","contributors_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/contributors","subscribers_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/subscribers","subscription_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/subscription","commits_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/commits{/sha}","git_commits_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/git/commits{/sha}","comments_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/comments{/number}","issue_comment_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/issues/comments{/number}","contents_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/contents/{+path}","compare_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/merges","archive_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/downloads","issues_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/issues{/number}","pulls_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/pulls{/number}","milestones_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/milestones{/number}","notifications_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/labels{/name}","releases_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/releases{/id}","deployments_url":"https://api.github.com/repos/mihaimorariu/chainer-chemistry/deployments","created_at":"2018-04-13T00:44:38Z","updated_at":"2018-05-18T00:31:47Z","pushed_at":"2018-05-18T01:35:16Z","git_url":"git://github.com/mihaimorariu/chainer-chemistry.git","ssh_url":"git@github.com:mihaimorariu/chainer-chemistry.git","clone_url":"https://github.com/mihaimorariu/chainer-chemistry.git","svn_url":"https://github.com/mihaimorariu/chainer-chemistry","homepage":"","size":836,"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":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pfnet-research:master","ref":"master","sha":"0f92d11fb491d50a7982466494f7a9f7ee23063c","user":{"login":"pfnet-research","id":23070723,"avatar_url":"https://avatars2.githubusercontent.com/u/23070723?v=4","gravatar_id":"","url":"https://api.github.com/users/pfnet-research","html_url":"https://github.com/pfnet-research","followers_url":"https://api.github.com/users/pfnet-research/followers","following_url":"https://api.github.com/users/pfnet-research/following{/other_user}","gists_url":"https://api.github.com/users/pfnet-research/gists{/gist_id}","starred_url":"https://api.github.com/users/pfnet-research/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfnet-research/subscriptions","organizations_url":"https://api.github.com/users/pfnet-research/orgs","repos_url":"https://api.github.com/users/pfnet-research/repos","events_url":"https://api.github.com/users/pfnet-research/events{/privacy}","received_events_url":"https://api.github.com/users/pfnet-research/received_events","type":"Organization","site_admin":false},"repo":{"id":112321712,"name":"chainer-chemistry","full_name":"pfnet-research/chainer-chemistry","owner":{"login":"pfnet-research","id":23070723,"avatar_url":"https://avatars2.githubusercontent.com/u/23070723?v=4","gravatar_id":"","url":"https://api.github.com/users/pfnet-research","html_url":"https://github.com/pfnet-research","followers_url":"https://api.github.com/users/pfnet-research/followers","following_url":"https://api.github.com/users/pfnet-research/following{/other_user}","gists_url":"https://api.github.com/users/pfnet-research/gists{/gist_id}","starred_url":"https://api.github.com/users/pfnet-research/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfnet-research/subscriptions","organizations_url":"https://api.github.com/users/pfnet-research/orgs","repos_url":"https://api.github.com/users/pfnet-research/repos","events_url":"https://api.github.com/users/pfnet-research/events{/privacy}","received_events_url":"https://api.github.com/users/pfnet-research/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pfnet-research/chainer-chemistry","description":"Chainer Chemistry: A Library for Deep Learning in Biology and Chemistry","fork":false,"url":"https://api.github.com/repos/pfnet-research/chainer-chemistry","forks_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/forks","keys_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/teams","hooks_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/hooks","issue_events_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/issues/events{/number}","events_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/events","assignees_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/assignees{/user}","branches_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/branches{/branch}","tags_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/tags","blobs_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/git/refs{/sha}","trees_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/statuses/{sha}","languages_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/languages","stargazers_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/stargazers","contributors_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/contributors","subscribers_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/subscribers","subscription_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/subscription","commits_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/commits{/sha}","git_commits_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/git/commits{/sha}","comments_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/comments{/number}","issue_comment_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/issues/comments{/number}","contents_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/contents/{+path}","compare_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/merges","archive_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/downloads","issues_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/issues{/number}","pulls_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/pulls{/number}","milestones_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/milestones{/number}","notifications_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/labels{/name}","releases_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/releases{/id}","deployments_url":"https://api.github.com/repos/pfnet-research/chainer-chemistry/deployments","created_at":"2017-11-28T10:35:09Z","updated_at":"2018-05-16T08:16:18Z","pushed_at":"2018-05-18T01:34:06Z","git_url":"git://github.com/pfnet-research/chainer-chemistry.git","ssh_url":"git@github.com:pfnet-research/chainer-chemistry.git","clone_url":"https://github.com/pfnet-research/chainer-chemistry.git","svn_url":"https://github.com/pfnet-research/chainer-chemistry","homepage":"","size":836,"stargazers_count":189,"watchers_count":189,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":32,"open_issues":18,"watchers":189,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pfnet-research/chainer-chemistry/pulls/169"},"html":{"href":"https://github.com/pfnet-research/chainer-chemistry/pull/169"},"issue":{"href":"https://api.github.com/repos/pfnet-research/chainer-chemistry/issues/169"},"comments":{"href":"https://api.github.com/repos/pfnet-research/chainer-chemistry/issues/169/comments"},"review_comments":{"href":"https://api.github.com/repos/pfnet-research/chainer-chemistry/pulls/169/comments"},"review_comment":{"href":"https://api.github.com/repos/pfnet-research/chainer-chemistry/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pfnet-research/chainer-chemistry/pulls/169/commits"},"statuses":{"href":"https://api.github.com/repos/pfnet-research/chainer-chemistry/statuses/3af441bfdcc7e25f7ea2dcc58f9865ba26226d2d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"corochann"}}