Skip to content

Commit

Permalink
minor code clean
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaydwivedi75 committed Nov 2, 2020
1 parent bd33f29 commit e72d43a
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion data/SBMs.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def positional_encoding(g, pos_enc_dim):
#EigVal, EigVec = sp.linalg.eigs(L, k=pos_enc_dim+1, which='SR')
EigVal, EigVec = sp.linalg.eigs(L, k=pos_enc_dim+1, which='SR', tol=1e-2) # for 40 PEs
EigVec = EigVec[:, EigVal.argsort()] # increasing order
g.ndata['pos_enc'] = torch.from_numpy(EigVec[:,1:pos_enc_dim+1]).float()
g.ndata['pos_enc'] = torch.from_numpy(np.real(EigVec[:,1:pos_enc_dim+1])).float()

return g

Expand Down
9 changes: 4 additions & 5 deletions docs/03_run_codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,10 @@ tensorboard --logdir='./' --port 6006


#### 2.3 To see the training logs in Tensorboard on remote machine
1. Go to the logs directory, i.e. `out/molecules_graph_regression/logs/`.
2. Run the [script](../scripts/TensorBoard/script_tensorboard.sh) with `bash script_tensorboard.sh`.
3. On your local machine, run the command `ssh -N -f -L localhost:6006:localhost:6006 user@xx.xx.xx.xx`.
4. Open `http://localhost:6006` in your browser. Note that `user@xx.xx.xx.xx` corresponds to your user login and the IP of the remote machine.

1. Move this [script](../scripts/TensorBoard/script_tensorboard.sh) to the root of the repository, i.e. benchmarking-gnns/.
2. Run the script `bash script_tensorboard.sh`.
3. On your local machine, run the command `ssh -N -f -L localhost:6006:localhost:6006 user@xx.xx.xx.xx`.
4. Open `http://localhost:6006` in your browser. Note that `user@xx.xx.xx.xx` corresponds to your user login and the IP of the remote machine.


<br>
Expand Down
6 changes: 3 additions & 3 deletions main_COLLAB_edge_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@
" return device\n",
"\n",
"\n",
"use_gpu = True\n",
"gpu_id = -1\n",
"device = None\n"
"# select GPU or CPU\n",
"#use_gpu = True; gpu_id = 0; device = None # default GPU\n",
"use_gpu = False; gpu_id = -1; device = None # CPU\n"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions main_CSL_graph_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@
" return device\n",
"\n",
"\n",
"use_gpu = True\n",
"gpu_id = -1\n",
"device = None\n"
"# select GPU or CPU\n",
"#use_gpu = True; gpu_id = 0; device = None # default GPU\n",
"use_gpu = False; gpu_id = -1; device = None # CPU\n"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions main_SBMs_node_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@
" return device\n",
"\n",
"\n",
"use_gpu = True\n",
"gpu_id = -1\n",
"device = None"
"# select GPU or CPU\n",
"#use_gpu = True; gpu_id = 0; device = None # default GPU\n",
"use_gpu = False; gpu_id = -1; device = None # CPU"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions main_TSP_edge_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@
" return device\n",
"\n",
"\n",
"use_gpu = True\n",
"gpu_id = -1\n",
"device = None\n"
"# select GPU or CPU\n",
"#use_gpu = True; gpu_id = 0; device = None # default GPU\n",
"use_gpu = False; gpu_id = -1; device = None # CPU\n"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions main_TUs_graph_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@
" return device\n",
"\n",
"\n",
"use_gpu = True\n",
"gpu_id = -1\n",
"device = None\n"
"# select GPU or CPU\n",
"#use_gpu = True; gpu_id = 0; device = None # default GPU\n",
"use_gpu = False; gpu_id = -1; device = None # CPU\n"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions main_molecules_graph_regression.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@
" return device\n",
"\n",
"\n",
"use_gpu = True\n",
"gpu_id = -1\n",
"device = None"
"# select GPU or CPU\n",
"#use_gpu = True; gpu_id = 0; device = None # default GPU\n",
"use_gpu = False; gpu_id = -1; device = None # CPU"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions main_superpixels_graph_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@
" return device\n",
"\n",
"\n",
"use_gpu = True\n",
"gpu_id = -1\n",
"device = None\n"
"# select GPU or CPU\n",
"#use_gpu = True; gpu_id = 0; device = None # default GPU\n",
"use_gpu = False; gpu_id = -1; device = None # CPU\n"
]
},
{
Expand Down

0 comments on commit e72d43a

Please sign in to comment.