Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/bkj/pytorch-graphsage
Browse files Browse the repository at this point in the history
  • Loading branch information
bkj committed May 8, 2018
2 parents f995480 + e7db30e commit a895546
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
def set_seeds(seed=0):
np.random.seed(seed)
_ = torch.manual_seed(seed)
_ = torch.cuda.manual_seed(seed)
if torch.cuda.is_available():
_ = torch.cuda.manual_seed(seed)


def to_numpy(x):
Expand Down
10 changes: 7 additions & 3 deletions utils/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ def save_problem(problem, outpath):
assert validate_problem(problem)
assert not os.path.exists(outpath), 'save_problem: %s already exists' % outpath

if 'sparse' in problem and problem['sparse']:
problem['adj'] = spadj2edgelist(problem['adj'])
problem['train_adj'] = spadj2edgelist(problem['train_adj'])

f = h5py.File(outpath)
for k,v in problem.items():
if v is not None:
Expand Down Expand Up @@ -212,11 +216,11 @@ def parse_args():
# "n_classes" : n_classes,

# "sparse" : True,
# "adj" : spadj2edgelist(adj),
# "train_adj" : spadj2edgelist(train_adj),
# "adj" : adj,
# "train_adj" : train_adj,

# "feats" : aug_feats,
# "targets" : aug_targets,
# "folds" : aug_folds,
# }, './data/reddit/sparse-problem.h5')
# # <<
# # <<

0 comments on commit a895546

Please sign in to comment.