Skip to content

Commit

Permalink
Apply renaming of topobenchmark folder
Browse files Browse the repository at this point in the history
  • Loading branch information
gbg141 committed Dec 4, 2024
1 parent 539b8ca commit 86fbe10
Show file tree
Hide file tree
Showing 209 changed files with 775 additions and 774 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
- uses: actions/checkout@v3
- uses: chartboost/ruff-action@v1
with:
src: './topobenchmarkx'
src: './topobenchmark'
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
hooks:
- id: ruff-format

- repo: https://github.com/numpy/numpydoc
rev: v1.6.0
hooks:
- id: numpydoc-validation
# - repo: https://github.com/numpy/numpydoc
# rev: v1.6.0
# hooks:
# - id: numpydoc-validation
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ If you do not have conda on your machine, please follow [their guide](https://do
First, clone the `TopoBenchmark` repository and set up a conda environment `tbx` with python 3.11.3.

```
git clone [email protected]:geometric-intelligence/topobenchmarkx.git
git clone [email protected]:geometric-intelligence/topobenchmark.git
cd TopoBenchmark
conda create -n tbx python=3.11.3
```
Expand All @@ -79,13 +79,13 @@ This command installs the `TopoBenchmark` library and its dependencies.
Next, train the neural networks by running the following command:

```
python -m topobenchmarkx
python -m topobenchmark
```

Thanks to `hydra` implementation, one can easily override the default experiment configuration through the command line. For instance, the model and dataset can be selected as:

```
python -m topobenchmarkx model=cell/cwn dataset=graph/MUTAG
python -m topobenchmark model=cell/cwn dataset=graph/MUTAG
```

**Remark:** By default, our pipeline identifies the source and destination topological domains, and applies a default lifting between them if required.
Expand Down Expand Up @@ -160,7 +160,7 @@ To implement and train a GCCN, run the following command line with the desired c


```
python -m topobenchmarkx \
python -m topobenchmark \
dataset=graph/PROTEINS \
dataset.split_params.data_seed=1 \
model=cell/topotune\
Expand Down Expand Up @@ -284,25 +284,25 @@ For ease of use, TopoBenchmark employs <img src="https://github.com/wesbos/Font-

First, clone the repository and navigate to the correct folder.
```
git clone [email protected]:geometric-intelligence/topobenchmarkx.git
git clone [email protected]:geometric-intelligence/topobenchmark.git
cd TopoBenchmark
```

Then, build the Docker image.
```
docker build -t topobenchmarkx:new .
docker build -t topobenchmark:new .
```

Depending if you want to use GPUs or not, these are the commands to run the Docker image and mount the current directory.

With GPUs
```
docker run -it -d --gpus all --volume $(pwd):/TopoBenchmark topobenchmarkx:new
docker run -it -d --gpus all --volume $(pwd):/TopoBenchmark topobenchmark:new
```

With CPU
```
docker run -it -d --volume $(pwd):/TopoBenchmark topobenchmarkx:new
docker run -it -d --volume $(pwd):/TopoBenchmark topobenchmark:new
```

Happy development!
Expand Down
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# numpydoc ignore=GL08
import configs
import test
import topobenchmarkx
import topobenchmark

__all__ = [
"configs",
"test",
"topobenchmarkx",
"topobenchmark",
]

__version__ = "0.0.1"
2 changes: 1 addition & 1 deletion configs/dataset/graph/AQSOL.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.MoleculeDatasetLoader
_target_: topobenchmark.data.loaders.MoleculeDatasetLoader
parameters:
data_domain: graph
data_type: AQSOL
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/IMDB-BINARY.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.TUDatasetLoader
_target_: topobenchmark.data.loaders.TUDatasetLoader
parameters:
data_domain: graph
data_type: TUDataset
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/IMDB-MULTI.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.TUDatasetLoader
_target_: topobenchmark.data.loaders.TUDatasetLoader
parameters:
data_domain: graph
data_type: TUDataset
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/MUTAG.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.TUDatasetLoader
_target_: topobenchmark.data.loaders.TUDatasetLoader
parameters:
data_domain: graph
data_type: TUDataset
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/NCI1.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
loader:
_target_: topobenchmarkx.data.loaders.TUDatasetLoader
_target_: topobenchmark.data.loaders.TUDatasetLoader
parameters:
data_domain: graph
data_type: TUDataset
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/NCI109.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
loader:
_target_: topobenchmarkx.data.loaders.TUDatasetLoader
_target_: topobenchmark.data.loaders.TUDatasetLoader
parameters:
data_domain: graph
data_type: TUDataset
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/PROTEINS.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.TUDatasetLoader
_target_: topobenchmark.data.loaders.TUDatasetLoader
parameters:
data_domain: graph
data_type: TUDataset
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/REDDIT-BINARY.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.TUDatasetLoader
_target_: topobenchmark.data.loaders.TUDatasetLoader
parameters:
data_domain: graph
data_type: TUDataset
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/US-county-demos.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.USCountyDemosDatasetLoader
_target_: topobenchmark.data.loaders.USCountyDemosDatasetLoader
parameters:
data_domain: graph
data_type: cornel
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/ZINC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.MoleculeDatasetLoader
_target_: topobenchmark.data.loaders.MoleculeDatasetLoader
parameters:
data_domain: graph
data_type: ZINC
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/amazon_ratings.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.HeterophilousGraphDatasetLoader
_target_: topobenchmark.data.loaders.HeterophilousGraphDatasetLoader
parameters:
data_domain: graph
data_type: heterophilic
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/cocitation_citeseer.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.PlanetoidDatasetLoader
_target_: topobenchmark.data.loaders.PlanetoidDatasetLoader
parameters:
data_domain: graph
data_type: cocitation
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/cocitation_cora.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.PlanetoidDatasetLoader
_target_: topobenchmark.data.loaders.PlanetoidDatasetLoader
parameters:
data_domain: graph
data_type: cocitation
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/cocitation_pubmed.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.PlanetoidDatasetLoader
_target_: topobenchmark.data.loaders.PlanetoidDatasetLoader
parameters:
data_domain: graph
data_type: cocitation
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/manual_dataset.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.ManualGraphDatasetLoader
_target_: topobenchmark.data.loaders.ManualGraphDatasetLoader
parameters:
data_domain: graph
data_type: manual_dataset
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/minesweeper.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.HeterophilousGraphDatasetLoader
_target_: topobenchmark.data.loaders.HeterophilousGraphDatasetLoader
parameters:
data_domain: graph
data_type: heterophilic
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/questions.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
loader:
_target_: topobenchmarkx.data.loaders.HeterophilousGraphDatasetLoader
_target_: topobenchmark.data.loaders.HeterophilousGraphDatasetLoader
parameters:
data_domain: graph
data_type: heterophilic
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/roman_empire.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.HeterophilousGraphDatasetLoader
_target_: topobenchmark.data.loaders.HeterophilousGraphDatasetLoader
parameters:
data_domain: graph
data_type: heterophilic
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/graph/tolokers.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.HeterophilousGraphDatasetLoader
_target_: topobenchmark.data.loaders.HeterophilousGraphDatasetLoader
parameters:
data_domain: graph
data_type: heterophilic
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/hypergraph/coauthorship_cora.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.CitationHypergraphDatasetLoader
_target_: topobenchmark.data.loaders.CitationHypergraphDatasetLoader
parameters:
data_domain: hypergraph
data_type: coauthorship
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/hypergraph/coauthorship_dblp.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.CitationHypergraphDatasetLoader
_target_: topobenchmark.data.loaders.CitationHypergraphDatasetLoader
parameters:
data_domain: hypergraph
data_type: coauthorship
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/hypergraph/cocitation_citeseer.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.CitationHypergraphDatasetLoader
_target_: topobenchmark.data.loaders.CitationHypergraphDatasetLoader
parameters:
data_domain: hypergraph
data_type: cocitation
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/hypergraph/cocitation_cora.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.CitationHypergraphDatasetLoader
_target_: topobenchmark.data.loaders.CitationHypergraphDatasetLoader
parameters:
data_domain: hypergraph
data_type: cocitation
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/hypergraph/cocitation_pubmed.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dataset loader config
loader:
_target_: topobenchmarkx.data.loaders.CitationHypergraphDatasetLoader
_target_: topobenchmark.data.loaders.CitationHypergraphDatasetLoader
parameters:
data_domain: hypergraph
data_type: cocitation
Expand Down
2 changes: 1 addition & 1 deletion configs/dataset/simplicial/karate_club.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_target_: topobenchmarkx.data.loaders.SimplicialLoader
_target_: topobenchmark.data.loaders.SimplicialLoader

# Data definition
parameters:
Expand Down
2 changes: 1 addition & 1 deletion configs/evaluator/classification.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_target_: topobenchmarkx.evaluator.evaluator.TBXEvaluator
_target_: topobenchmark.evaluator.evaluator.TBXEvaluator
task: ${dataset.parameters.task}
task_level: ${dataset.parameters.task_level}
num_classes: ${dataset.parameters.num_classes}
Expand Down
2 changes: 1 addition & 1 deletion configs/evaluator/default.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_target_: topobenchmarkx.evaluator.evaluator.TBXEvaluator
_target_: topobenchmark.evaluator.evaluator.TBXEvaluator
task: ${dataset.parameters.task}
task_level: ${dataset.parameters.task_level}
num_classes: ${dataset.parameters.num_classes}
Expand Down
2 changes: 1 addition & 1 deletion configs/evaluator/regression.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_target_: topobenchmarkx.evaluator.evaluator.TBXEvaluator
_target_: topobenchmark.evaluator.evaluator.TBXEvaluator
task: ${dataset.parameters.task}
task_level: ${dataset.parameters.task_level}
num_classes: ${dataset.parameters.num_classes}
Expand Down
2 changes: 1 addition & 1 deletion configs/loss/default.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_target_: topobenchmarkx.loss.TBXLoss
_target_: topobenchmark.loss.TBXLoss

dataset_loss:
task: ${dataset.parameters.task}
Expand Down
8 changes: 4 additions & 4 deletions configs/model/cell/can.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
_target_: topobenchmarkx.model.TBXModel
_target_: topobenchmark.model.TBXModel

model_name: can
model_domain: cell

feature_encoder:
_target_: topobenchmarkx.nn.encoders.${model.feature_encoder.encoder_name}
_target_: topobenchmark.nn.encoders.${model.feature_encoder.encoder_name}
encoder_name: AllCellFeatureEncoder
in_channels: ${infer_in_channels:${dataset},${oc.select:transforms,null}}
out_channels: 128
Expand All @@ -26,14 +26,14 @@ backbone:
att_lift: False

backbone_wrapper:
_target_: topobenchmarkx.nn.wrappers.CANWrapper
_target_: topobenchmark.nn.wrappers.CANWrapper
_partial_: true
wrapper_name: CANWrapper
out_channels: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_num_cell_dimensions:${oc.select:model.feature_encoder.selected_dimensions,null},${model.feature_encoder.in_channels}}

readout:
_target_: topobenchmarkx.nn.readouts.${model.readout.readout_name}
_target_: topobenchmark.nn.readouts.${model.readout.readout_name}
readout_name: PropagateSignalDown # Use <NoReadOut> in case readout is not needed Options: PropagateSignalDown
num_cell_dimensions: ${infere_num_cell_dimensions:${oc.select:model.feature_encoder.selected_dimensions,null},${model.feature_encoder.in_channels}} # The highest order of cell dimensions to consider
hidden_dim: ${model.feature_encoder.out_channels}
Expand Down
10 changes: 5 additions & 5 deletions configs/model/cell/cccn.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
_target_: topobenchmarkx.model.TBXModel
_target_: topobenchmark.model.TBXModel

model_name: cccn
model_domain: cell

feature_encoder:
_target_: topobenchmarkx.nn.encoders.${model.feature_encoder.encoder_name}
_target_: topobenchmark.nn.encoders.${model.feature_encoder.encoder_name}
encoder_name: AllCellFeatureEncoder
in_channels: ${infer_in_channels:${dataset},${oc.select:transforms,null}}
out_channels: 32
Expand All @@ -14,20 +14,20 @@ feature_encoder:
- 1

backbone:
_target_: topobenchmarkx.nn.backbones.cell.cccn.CCCN
_target_: topobenchmark.nn.backbones.cell.cccn.CCCN
in_channels: ${model.feature_encoder.out_channels}
n_layers: 4
dropout: 0.0

backbone_wrapper:
_target_: topobenchmarkx.nn.wrappers.CCCNWrapper
_target_: topobenchmark.nn.wrappers.CCCNWrapper
_partial_: true
wrapper_name: CCCNWrapper
out_channels: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_num_cell_dimensions:${oc.select:model.feature_encoder.selected_dimensions,null},${model.feature_encoder.in_channels}}

readout:
_target_: topobenchmarkx.nn.readouts.${model.readout.readout_name}
_target_: topobenchmark.nn.readouts.${model.readout.readout_name}
readout_name: PropagateSignalDown # Use <NoReadOut> in case readout is not needed Options: PropagateSignalDown
num_cell_dimensions: ${infere_num_cell_dimensions:${oc.select:model.feature_encoder.selected_dimensions,null},${model.feature_encoder.in_channels}} # The highest order of cell dimensions to consider
hidden_dim: ${model.feature_encoder.out_channels}
Expand Down
Loading

0 comments on commit 86fbe10

Please sign in to comment.