Unverified Commit 4a8cc489 authored by Hao Xiong's avatar Hao Xiong Committed by GitHub
Browse files
parent d2ccd218
...@@ -15,7 +15,7 @@ For evaluatation we follow the code mlp.py provided by ogb [here](https://github ...@@ -15,7 +15,7 @@ For evaluatation we follow the code mlp.py provided by ogb [here](https://github
## Used config ## Used config
ogbl-collab ogbl-collab
``` ```
python3 deepwalk.py --ogbl_name ogbl-collab --load_from_ogbl --save_in_pt --output_emb_file embedding.pt --num_walks 50 --window_size 20 --walk_length 40 --lr 0.1 --negative 1 --neg_weight 1 --lap_norm 0.005 --mix --gpus 0 --num_threads 4 --print_interval 2000 --print_loss --batch_size 32 python3 deepwalk.py --ogbl_name ogbl-collab --load_from_ogbl --save_in_pt --output_emb_file collab-embedding.pt --num_walks 50 --window_size 2 --walk_length 40 --lr 0.1 --negative 1 --neg_weight 1 --lap_norm 0.01 --mix --gpus 0 --num_threads 4 --print_interval 2000 --print_loss --batch_size 128 --use_context_weight
cd ./ogb/blob/master/examples/linkproppred/collab/ cd ./ogb/blob/master/examples/linkproppred/collab/
cp embedding_pt_file_path ./ cp embedding_pt_file_path ./
python3 mlp.py --device 0 --runs 10 --use_node_embedding python3 mlp.py --device 0 --runs 10 --use_node_embedding
......
...@@ -31,7 +31,7 @@ if __name__ == "__main__": ...@@ -31,7 +31,7 @@ if __name__ == "__main__":
if weighted: if weighted:
f.write(str(g.edges()[0][i].item()) + " "\ f.write(str(g.edges()[0][i].item()) + " "\
+str(g.edges()[1][i].item()) + " "\ +str(g.edges()[1][i].item()) + " "\
+str(g.edata['edge_weight'][i]) + "\n") +str(g.edata['edge_weight'][i].item()) + "\n")
else: else:
f.write(str(g.edges()[0][i].item()) + " "\ f.write(str(g.edges()[0][i].item()) + " "\
+str(g.edges()[1][i].item()) + " "\ +str(g.edges()[1][i].item()) + " "\
......
...@@ -511,7 +511,7 @@ class SkipGramModel(nn.Module): ...@@ -511,7 +511,7 @@ class SkipGramModel(nn.Module):
valid_seeds = torch.LongTensor(dataset.valid_seeds) valid_seeds = torch.LongTensor(dataset.valid_seeds)
valid_embedding = self.u_embeddings.weight.cpu().data.index_select(0, valid_embedding = self.u_embeddings.weight.cpu().data.index_select(0,
valid_seeds) valid_seeds)
embedding.index_add_(0, valid_seeds, self.u_embeddings.weight.cpu().data) embedding.index_add_(0, valid_seeds, valid_embedding)
if self.norm: if self.norm:
embedding /= torch.sqrt(torch.sum(embedding.mul(embedding), 1) + 1e-6).unsqueeze(1) embedding /= torch.sqrt(torch.sum(embedding.mul(embedding), 1) + 1e-6).unsqueeze(1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment