Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "doc_repo"]
path = doc_repo
url = ../graph_datasets_docs
1 change: 1 addition & 0 deletions doc_repo
Submodule doc_repo added at a464bc
13 changes: 8 additions & 5 deletions graph_datasets/utils/model_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,14 @@ def load_model(
def set_seed(seed: int = 4096) -> None:
"""Set random seed.

NOTE:!!! conv and neighborSampler of dgl is somehow nondeterministic !!!

Set according to the pytorch doc: https://pytorch.org/docs/1.9.0/notes/randomness.html
cudatoolkit doc: https://docs.nvidia.com/cuda/cublas/index.html#cublasApi_reproducibility
dgl issue: https://github.com/dmlc/dgl/issues/3302
NOTE:
!!! `conv` and `neighborSampler` of dgl are somehow nondeterministic !!!

Set seeds according to:
- `pytorch doc <https://pytorch.org/docs/1.9.0/notes/randomness.html>`_
- `cudatoolkit doc \
<https://docs.nvidia.com/cuda/cublas/index.html#cublasApi_reproducibility>`_
- `dgl issue <https://github.com/dmlc/dgl/issues/3302>`_

Args:
seed (int, optional): random seed. Defaults to 4096.
Expand Down
16 changes: 16 additions & 0 deletions graph_datasets/utils/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,29 @@ def csv2file(
"NMI": "89.0",
}
thead=[]
# list of values
csv2file(
target_path=save_file,
thead=list(final_params.keys()),
tbody=list(final_params.values()),
refresh=False,
is_dict=False,
)
# list of dicts
csv2file(
target_path=save_file,
tbody=[
{
"a": 1,
"b": 2
},
{
"a": 2,
"b": 1
},
],
is_dict=True,
)
"""
target_path: PurePath = Path(target_path)
if refresh:
Expand Down