Skip to content

Commit

Permalink
Merge pull request #10 from KeishiS/modify_pkg_ver
Browse files Browse the repository at this point in the history
Pinned Python and its package versions & Modified some function arguments due to version update
  • Loading branch information
mtog authored Sep 1, 2024
2 parents b7aee69 + 9137cfe commit 107a8df
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions experiments/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.8
3 changes: 2 additions & 1 deletion experiments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This script reproduces the experiment presented in the paper for 2 datasets.
Before launching the script, ensure to ahve the following dependencies installed:
- `numpy`
- `scikit-learn`
- `pandas`
- `POT` ([github](https://github.com/rflamary/POT))
- `python-igraph`

Expand All @@ -32,4 +33,4 @@ optional arguments:

# For example:
python main.py -d ENZYMES --gridsearch --crossvalidation --h 7
```
```
6 changes: 4 additions & 2 deletions experiments/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ def main():

# Save embeddings to output folder
out_name = f'{dataset}_wl_{embedding_type}_embeddings_h{h}.npy'
np.save(os.path.join(output_path, out_name), label_sequences)
np.save(
os.path.join(output_path, out_name),
np.array(label_sequences, dtype=object))
print(f'Embeddings for {dataset} computed, saved to {os.path.join(output_path, out_name)}.')
print()

Expand Down Expand Up @@ -177,4 +179,4 @@ def main():
print('No results saved to file as --crossvalidation or --gridsearch were not selected.')

if __name__ == '__main__':
main()
main()
16 changes: 16 additions & 0 deletions experiments/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Cython==3.0.11
igraph==0.11.6
joblib==1.4.2
numpy==1.23.5
pandas==2.0.3
POT==0.9.4
python-dateutil==2.9.0.post0
python-igraph==0.11.6
pytz==2024.1
scikit-learn==0.23.2
scipy==1.10.1
six==1.16.0
texttable==1.7.0
threadpoolctl==3.5.0
tzdata==2024.1
wwl==0.1.2
2 changes: 1 addition & 1 deletion experiments/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def load_continuous_graphs(data_directory):
# If none is present, keep degree or label as features.
attribtues_filenames = os.path.join(data_directory, 'node_features.npy')
if os.path.isfile(attribtues_filenames):
node_features = np.load(attribtues_filenames)
node_features = np.load(attribtues_filenames, allow_pickle=True)

n_nodes = np.asarray(n_nodes)
node_features = np.asarray(node_features)
Expand Down

0 comments on commit 107a8df

Please sign in to comment.