Skip to content

Commit 4a7ec85

Browse files
authored
Merge pull request #344 from datamol-io/cleanup
Cleanup of dependencies and files
2 parents f4f8e2a + a3a9c09 commit 4a7ec85

File tree

10 files changed

+7
-133937
lines changed

10 files changed

+7
-133937
lines changed
File renamed without changes.

docs/design.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -101,24 +101,3 @@ Some loss functions are already implemented in the PredictorModule, including `m
101101
Our current code is compatible with the metrics defined by _pytorch-lightning_, which include a great set of metrics. We also added the PearsonR and SpearmanR as they are important correlation metrics. You can define any new metric in the file `graphium/trainer/metrics.py`. The metric must inherit from `TensorMetric` and must be added to the dictionary `graphium.trainer.metrics.METRICS_DICT`.
102102

103103
To use the metric, you can easily add it's name from `METRICS_DICT` in the yaml configuration file, at the address `metrics.metrics_dict`. Each metric has an underlying dictionnary with a mandatory `threshold` key containing information on how to threshold the prediction/target before computing the metric. Any `kwargs` arguments of the metric must also be added.
104-
105-
## (OLD) Running a hyper-parameter search
106-
107-
In the current repository, we use `hydra-core` to launch multiple experiments in a grid-search manner. It works by specifying the parameters that we want to change from a given YAML file.
108-
109-
Below is an example of running a set of 3\*2\*2\*2=24 experiments, 3 variations of the gnn type _layer_name_, 2 variations of the learning rate _lr_, 2 variations of the hidden dimension _hidden_dim_, 2 variations of the network depth _hidden_depth_. All parameters not mentionned in the code below are unchanged from the file `expts/main_micro_ZINC.py`.
110-
111-
python expts/main_micro_ZINC.py --multirun \
112-
model.layer_name=gin,gcn,pna-conv3 \
113-
constants.exp_name="testing_hydra" \
114-
constants.device="cuda:0" \
115-
constants.ignore_train_error=true \
116-
predictor.lr=1e-4,1e-3 \
117-
model.gnn_kwargs.hidden_dim=32,64 \
118-
model.gnn_kwargs.hidden_depth=4,8
119-
120-
The results of the run will be available in the folder `multirun/[CURRENT-DATE]/[CURRENT-TIME]`. To open the results in tensorflow, run the following command using _bash_ or _powershell_
121-
122-
`tensorboard --logdir 'multirun/[CURRENT-DATE]/[CURRENT-TIME]/' --port 8000`
123-
124-
Then open a web-browser and enter the address `http://localhost:8000/`.

env.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,12 @@ dependencies:
3030
# ML packages
3131
- cudatoolkit # works also with CPU-only system.
3232
- pytorch >=1.10.2,<2.0
33-
- tensorboard
33+
- torchvision
3434
- pytorch-lightning >=1.9
3535
- torchmetrics >=0.7.0,<0.11
36-
- hydra-core >=1.0
3736
- ogb
3837
- pytorch_geometric >=2.0 # Use `pyg` for Windows instead of `pytorch_geometric`
3938
- wandb
40-
- optuna
4139
- mup
4240
- pytorch_sparse >=0.6
4341
- pytorch_cluster >=1.5

expts/optuna/optuna_base_config.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

graphium/data/QM9/qm9.csv

Lines changed: 0 additions & 133886 deletions
This file was deleted.

graphium/trainer/predictor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ def _general_epoch_end(self, outputs: Dict[str, Any], step_name: str) -> None:
523523
metrics_logs = self.task_epoch_summary.get_metrics_logs()
524524
self.task_epoch_summary.set_results(task_metrics=metrics_logs)
525525

526-
return metrics_logs # Consider returning concatenated dict for tensorboard
526+
return metrics_logs # Consider returning concatenated dict for logging
527527

528528
def on_train_epoch_start(self) -> None:
529529
self.epoch_start_time = time.time()

graphium/trainer/predictor_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class EvalOptions:
132132
133133
metrics:
134134
A dictionnary of metrics to compute on the prediction, other than the loss function.
135-
These metrics will be logged into TensorBoard.
135+
These metrics will be logged into WandB or other.
136136
137137
metrics_on_progress_bar:
138138
The metrics names from `metrics` to display also on the progress bar of the training

graphium/trainer/predictor_summaries.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __init__(
5151
5252
metrics:
5353
A dictionnary of metrics to compute on the prediction, other than the loss function.
54-
These metrics will be logged into TensorBoard.
54+
These metrics will be logged into WandB or similar.
5555
5656
metrics_on_training_set:
5757
The metrics names from `metrics` to be computed on the training set for each iteration.
@@ -118,7 +118,7 @@ def set_results(
118118
metrics: a dictionary of metrics
119119
"""
120120

121-
# Include the task_name in the loss for tensorboard, and similarly for other metrics
121+
# Include the task_name in the loss for logging, and similarly for other metrics
122122
metrics[self.metric_log_name(self.task_name, "loss", self.step_name)] = self.loss
123123
self.summaries[self.step_name] = Summary.Results(
124124
targets=self.targets,
@@ -144,7 +144,7 @@ def is_best_epoch(self, step_name: str, loss: Tensor, metrics: Dict[str, Tensor]
144144
if not (step_name in self.best_summaries.keys()):
145145
return True
146146

147-
# Include the task_name in the loss for tensorboard, and similarly for other metrics
147+
# Include the task_name in the loss for logging, and similarly for other metrics
148148
metrics[self.metric_log_name(self.task_name, "loss", self.step_name)] = loss
149149
monitor_name = f"{self.monitor}/{step_name}" # Include task_name?
150150
if (

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ docs_dir: "docs"
1111

1212
nav:
1313
- Overview: index.md
14-
- Benchmark: benchmark.md
14+
- Baseline: baseline.md
1515
- API:
1616
- graphium.nn:
1717
- graphium.nn: api/graphium.nn/graphium.nn.md

pyproject.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,11 @@ dependencies = [
4747
"gcsfs >=2021.6",
4848
"platformdirs",
4949
# ML packages
50-
"tensorboard",
5150
"pytorch-lightning >=1.9",
5251
"torchmetrics >=0.7.0,<0.11",
53-
"hydra-core >=1.0",
5452
"ogb",
5553
"torch-geometric >=2.0",
5654
"wandb",
57-
"optuna",
5855
"mup",
5956
"torch_sparse >=0.6",
6057
"torch_cluster >=1.5",
@@ -98,10 +95,8 @@ minversion = "6.0"
9895
addopts = "--verbose --durations=10 -n auto"
9996
testpaths = ["tests"]
10097
filterwarnings = [
101-
"ignore::DeprecationWarning:tensorboard.*:",
10298
"ignore::DeprecationWarning:ray.*:",
10399
"ignore::DeprecationWarning:numba.*:",
104100
"ignore::DeprecationWarning:lightning_fabric.*:",
105101
"ignore::DeprecationWarning:pytorch_lightning.*:",
106-
"ignore::UserWarning:umap.*:",
107102
]

0 commit comments

Comments
 (0)