Cleaned up experimental run files.

This commit is contained in:
williamleif 2017-10-12 14:15:21 -07:00
parent c29361aa7d
commit 93d2aaf259
4 changed files with 11 additions and 6 deletions

View File

@ -31,11 +31,11 @@ def run_regression(train_embeds, train_labels, test_embeds, test_labels):
if __name__ == '__main__': if __name__ == '__main__':
parser = ArgumentParser("Run evaluation on citation data.") parser = ArgumentParser("Run evaluation on citation data.")
parser.add_argument("dataset_dir", help="Path to directory containing the dataset.") 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.") parser.add_argument("setting", help="Either val or test.")
args = parser.parse_args() args = parser.parse_args()
dataset_dir = args.dataset_dir dataset_dir = args.dataset_dir
data_dir = args.data_dir data_dir = args.embed_dir
setting = args.setting setting = args.setting
print("Loading data...") print("Loading data...")

View File

@ -21,11 +21,11 @@ def run_regression(train_embeds, train_labels, test_embeds, test_labels):
if __name__ == '__main__': if __name__ == '__main__':
parser = ArgumentParser("Run evaluation on PPI data.") parser = ArgumentParser("Run evaluation on PPI data.")
parser.add_argument("dataset_dir", help="Path to directory containing the dataset.") 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.") parser.add_argument("setting", help="Either val or test.")
args = parser.parse_args() args = parser.parse_args()
dataset_dir = args.dataset_dir dataset_dir = args.dataset_dir
data_dir = args.data_dir data_dir = args.embed_dir
setting = args.setting setting = args.setting
print("Loading data...") print("Loading data...")

View File

@ -24,11 +24,11 @@ def run_regression(train_embeds, train_labels, test_embeds, test_labels):
if __name__ == '__main__': if __name__ == '__main__':
parser = ArgumentParser("Run evaluation on Reddit data.") parser = ArgumentParser("Run evaluation on Reddit data.")
parser.add_argument("dataset_dir", help="Path to directory containing the dataset.") 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.") parser.add_argument("setting", help="Either val or test.")
args = parser.parse_args() args = parser.parse_args()
dataset_dir = args.dataset_dir dataset_dir = args.dataset_dir
data_dir = args.data_dir data_dir = args.embed_dir
setting = args.setting setting = args.setting
print("Loading data...") print("Loading data...")

View File

@ -59,13 +59,18 @@ class EdgeMinibatchIterator(object):
def _remove_isolated(self, edge_list): def _remove_isolated(self, edge_list):
new_edge_list = [] new_edge_list = []
missing = 0
for n1, n2 in edge_list: 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) \ 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[n1]['test'] or self.G.node[n1]['val']) \
and (not self.G.node[n2]['test'] or self.G.node[n2]['val']): and (not self.G.node[n2]['test'] or self.G.node[n2]['val']):
continue continue
else: else:
new_edge_list.append((n1,n2)) new_edge_list.append((n1,n2))
print("Unexpected missing:", missing)
return new_edge_list return new_edge_list
def construct_adj(self): def construct_adj(self):