Skip to content

Commit 524f665

Browse files
committed
readme - minor clarification
1 parent fe9b4ef commit 524f665

File tree

1 file changed

+20
-29
lines changed

1 file changed

+20
-29
lines changed

README.md

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ python -m chebai fit --trainer=configs/training/default_trainer.yml --trainer.lo
7878

7979
## Augmented Graphs
8080

81+
Below is the command for the model and data configuration that achieved the best classification performance using augmented graphs.
82+
83+
8184
```bash
8285
python -m chebai fit --trainer=configs/training/default_trainer.yml --trainer.logger=configs/training/wandb_logger.yml --model=../python-chebai-graph/configs/model/gat_aug_amgpool.yml --model.train_metrics=configs/metrics/micro-macro-f1.yml --model.test_metrics=configs/metrics/micro-macro-f1.yml --model.val_metrics=configs/metrics/micro-macro-f1.yml --model.config.v2=True --data=../python-chebai-graph/configs/data/chebi50_aug_prop_as_per_node.yml --data.init_args.batch_size=128 --trainer.accumulate_grad_batches=4 --data.init_args.num_workers=10 --model.pass_loss_kwargs=false --data.init_args.chebi_version=241 --trainer.min_epochs=200 --trainer.max_epochs=200 --model.criterion=configs/loss/bce.yml --trainer.logger.init_args.name=gatv2_amg_s0
8386
```
@@ -95,7 +98,7 @@ To use a GAT-based model, choose **one** of the following configs:
9598
#### GAT-specific hyperparameters
9699

97100
- **Number of message-passing layers**: `--model.config.num_layers=5` (default: 4)
98-
- **Attention heads**: `--model.config.heads=4` (Default: 8)
101+
- **Attention heads**: `--model.config.heads=4` (default: 8)
99102
> Note: The number of heads should be divisible by the output channels (or hidden channels if output channels are not specified).
100103
- **Use GATv2**: `--model.config.v2=True` (default: False)
101104

@@ -118,62 +121,50 @@ These can be used for both GAT and ResGated architectures:
118121

119122
## Static Node Initialization
120123

121-
In this type of node initialization, the node properties (and/or edge properties) of the given molecular graph are initialized only once during dataset creation with the given initialization scheme.
122-
124+
In this type of node initialization, the node features (and/or edge features) of the given molecular graph are initialized only once during dataset creation with the given initialization scheme.
123125

124-
```
126+
```bash
125127
python -m chebai fit --trainer=configs/training/default_trainer.yml --trainer.logger=configs/training/wandb_logger.yml --model=../python-chebai-graph/configs/model/resgated.yml --model.config.in_channels=203 --model.config.edge_dim=11 --model.train_metrics=configs/metrics/micro-macro-f1.yml --model.test_metrics=configs/metrics/micro-macro-f1.yml --model.val_metrics=configs/metrics/micro-macro-f1.yml --data=../python-chebai-graph/configs/data/chebi50_graph_properties.yml --data.pad_node_features=45 --data.pad_edge_features=4 --data.init_args.batch_size=128 --trainer.accumulate_grad_batches=4 --data.init_args.num_workers=10 --data.init_args.persistent_workers=False --model.pass_loss_kwargs=false --data.init_args.chebi_version=241 --trainer.min_epochs=200 --trainer.max_epochs=200 --model.criterion=configs/loss/bce.yml --trainer.logger.init_args.name=gni_res_props+zeros_s0
126128
```
127129

128-
In the above config, for each node we use the 158 node properties retrieved from RDKit and add 45 additional features (specified by `--data.pad_node_features=45`) drawn from a normal distribution (default). You can change the distribution using:
130+
In the above command, for each node we use the 158 node features (corresponding the node properties defined in `chebi50_graph_properties.yml`) which are retrieved from RDKit and add 45 additional features (specified by `--data.pad_node_features=45`) drawn from a normal distribution (default).
129131

130-
```
131-
--data.distribution=zeros
132-
```
132+
You can change the distribution using the following config in above command: `--data.distribution=zeros`
133133

134-
Available distributions:
134+
Available distributions: `"normal", "uniform", "xavier_normal", "xavier_uniform", "zeros"`
135135

136-
```
137-
["normal", "uniform", "xavier_normal", "xavier_uniform", "zeros"]
138-
```
139136

140-
Similarly, each edge is initialized with 7 RDKit properties and 4 additional features drawn from the given distribution.
137+
Similarly, each edge is initialized with 7 RDKit features and 4 additional features drawn from the given distribution.
141138

142139

143-
If you want all node (and edge) features to be drawn from a given distribution (i.e., ignore RDKit features), use:
140+
If you want all node (and edge) features to be drawn from a given distribution (i.e., ignore RDKit features), use: `--data=../python-chebai-graph/configs/data/chebi50_static_gni.yml`
144141

145-
```
146-
--data=../python-chebai-graph/configs/data/chebi50_static_gni.yml
147-
```
148142

149143
Refer to the data class code for details.
150144

151145

152146
## Dynamic Node Initialization
153147

154-
In this type of node initialization, the node properties (and/or edge properties) of the molecular graph are initialized at **each forward pass** of the model using the given initialization scheme.
148+
In this type of node initialization, the node features (and/or edge features) of the molecular graph are initialized at **each forward pass** of the model using the given initialization scheme.
155149

156-
Currently, dynamic node initialization is implemented only for the **resgated** architecture by specifying:
157150

158-
```
159-
--model=../python-chebai-graph/configs/model/resgated_dynamic_gni.yml
160-
```
161151

162-
To keep RDKit features and *add* dynamically initialized features:
152+
Currently, dynamic node initialization is implemented only for the **resgated** architecture by specifying: `--model=../python-chebai-graph/configs/model/resgated_dynamic_gni.yml`
153+
154+
To keep RDKit features and *add* dynamically initialized features use the following config in the command:
163155

164156
```
165157
--model.config.complete_randomness=False
166158
--model.config.pad_node_features=45
167159
```
168160

169-
The additional features are drawn from normal distribution (default). You can change it using:
170-
171-
```
172-
--model.config.distribution=uniform
173-
```
161+
The additional features are drawn from normal distribution (default). You can change it using:`--model.config.distribution=uniform`
174162

175163
If all features should be initialized from the given distribution, remove the complete_randomness flag (default is True).
176164

177-
```
165+
166+
Please find below the command for a typical dynamic node initialization:
167+
168+
```bash
178169
python -m chebai fit --trainer=configs/training/default_trainer.yml --trainer.logger=configs/training/wandb_logger.yml --model=../python-chebai-graph/configs/model/resgated_dynamic_gni.yml --model.config.in_channels=203 --model.config.edge_dim=11 --model.config.complete_randomness=False --model.config.pad_node_features=45 --model.config.pad_edge_features=4 --model.train_metrics=configs/metrics/micro-macro-f1.yml --model.test_metrics=configs/metrics/micro-macro-f1.yml --model.val_metrics=configs/metrics/micro-macro-f1.yml --data=../python-chebai-graph/configs/data/chebi50_graph_properties.yml --data.init_args.batch_size=128 --trainer.accumulate_grad_batches=4 --data.init_args.num_workers=10 --data.init_args.persistent_workers=False --model.pass_loss_kwargs=false --data.init_args.chebi_version=241 --trainer.min_epochs=200 --trainer.max_epochs=200 --model.criterion=configs/loss/bce.yml --trainer.logger.init_args.name=gni_dres_props+rand_s0
179170
```

0 commit comments

Comments
 (0)