diff --git a/eval_scripts/citation_eval.py b/eval_scripts/citation_eval.py index 3707a53..feb69cc 100644 --- a/eval_scripts/citation_eval.py +++ b/eval_scripts/citation_eval.py @@ -31,11 +31,11 @@ def run_regression(train_embeds, train_labels, test_embeds, test_labels): if __name__ == '__main__': parser = ArgumentParser("Run evaluation on citation data.") parser.add_argument("dataset_dir", help="Path to directory containing the dataset.") - parser.add_argument("data_dir", help="Path to directory containing the learned node embeddings.") + parser.add_argument("embed_dir", help="Path to directory containing the learned node embeddings.") parser.add_argument("setting", help="Either val or test.") args = parser.parse_args() dataset_dir = args.dataset_dir - data_dir = args.data_dir + data_dir = args.embed_dir setting = args.setting print("Loading data...") diff --git a/eval_scripts/ppi_eval.py b/eval_scripts/ppi_eval.py index 88b7a9e..9348926 100644 --- a/eval_scripts/ppi_eval.py +++ b/eval_scripts/ppi_eval.py @@ -21,11 +21,11 @@ def run_regression(train_embeds, train_labels, test_embeds, test_labels): if __name__ == '__main__': parser = ArgumentParser("Run evaluation on PPI data.") parser.add_argument("dataset_dir", help="Path to directory containing the dataset.") - parser.add_argument("data_dir", help="Path to directory containing the learned node embeddings. Set to 'feat' for raw features.") + parser.add_argument("embed_dir", help="Path to directory containing the learned node embeddings. Set to 'feat' for raw features.") parser.add_argument("setting", help="Either val or test.") args = parser.parse_args() dataset_dir = args.dataset_dir - data_dir = args.data_dir + data_dir = args.embed_dir setting = args.setting print("Loading data...") diff --git a/eval_scripts/reddit_eval.py b/eval_scripts/reddit_eval.py index a0f68c6..7161084 100644 --- a/eval_scripts/reddit_eval.py +++ b/eval_scripts/reddit_eval.py @@ -24,11 +24,11 @@ def run_regression(train_embeds, train_labels, test_embeds, test_labels): if __name__ == '__main__': parser = ArgumentParser("Run evaluation on Reddit data.") parser.add_argument("dataset_dir", help="Path to directory containing the dataset.") - parser.add_argument("data_dir", help="Path to directory containing the learned node embeddings. Set to 'feat' for raw features.") + parser.add_argument("embed_dir", help="Path to directory containing the learned node embeddings. Set to 'feat' for raw features.") parser.add_argument("setting", help="Either val or test.") args = parser.parse_args() dataset_dir = args.dataset_dir - data_dir = args.data_dir + data_dir = args.embed_dir setting = args.setting print("Loading data...") diff --git a/graphsage/minibatch.py b/graphsage/minibatch.py index 60c7b97..1cfd6d9 100644 --- a/graphsage/minibatch.py +++ b/graphsage/minibatch.py @@ -59,13 +59,18 @@ class EdgeMinibatchIterator(object): def _remove_isolated(self, edge_list): new_edge_list = [] + missing = 0 for n1, n2 in edge_list: + if not n1 in self.G.node or not n2 in self.G.node: + missing += 1 + continue if (self.deg[self.id2idx[n1]] == 0 or self.deg[self.id2idx[n2]] == 0) \ and (not self.G.node[n1]['test'] or self.G.node[n1]['val']) \ and (not self.G.node[n2]['test'] or self.G.node[n2]['val']): continue else: new_edge_list.append((n1,n2)) + print("Unexpected missing:", missing) return new_edge_list def construct_adj(self):