Skip to content

Commit

Permalink
Merge pull request #97 from geometric-intelligence/resolver_fix
Browse files Browse the repository at this point in the history
Allow notebooks to use transform resolver
  • Loading branch information
levtelyatnikov authored Oct 31, 2024
2 parents 1082a73 + ea28c1c commit 3265ef4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion configs/run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
defaults:
- _self_
- dataset: graph/cocitation_cora
- model: cell/topotune
- model: graph/gcn
- transforms: ${get_default_transform:${dataset},${model}} #no_transform
- optimizer: default
- loss: default
Expand Down
9 changes: 7 additions & 2 deletions topobenchmarkx/utils/config_resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ def get_default_transform(dataset, model):
if data_domain == "graph" and model_domain != "combinatorial":
# Check if there is a default transform for the dataset at ./configs/transforms/dataset_defaults/
# If not, use the default lifting transform for the dataset to be compatible with the model
base_dir = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
)
configs_dir = os.path.join(
base_dir, "configs", "transforms", "dataset_defaults"
)
datasets_with_defaults = [
f.split(".")[0]
for f in os.listdir("./configs/transforms/dataset_defaults/")
f.split(".")[0] for f in os.listdir(configs_dir)
]
if dataset in datasets_with_defaults:
return f"dataset_defaults/{dataset}"
Expand Down

0 comments on commit 3265ef4

Please sign in to comment.