You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Graph Neural Networks (GNNs) often fail to explicitly leverage the chemically meaningful substructures present within molecules (i.e. **functional groups (FGs)**). To make this implicit information explicitly accessible to GNNs, we augment molecular graphs with **artificial nodes** that represent these substructures. The resulting graph are referred to as **augmented graphs**.
83
+
> Note: Rings are also treated as functional groups in our work.
84
+
85
+
In these augmented graphs, each functional group node is connected to the atoms that constitute the group. Additionally, two functional group nodes are connected if any atom belonging to one group shares a bond with an atom from the other group. We further introduce a **graph node**, an extra node connected to all functional group nodes.
86
+
87
+
Among all the connection schemes we evaluated, this configuration delivered the strongest performance. We denote it using the abbreviation **WFG_WFGE_WGN** in our work and is shown in below figure.
> With this pooling stratergy, the learned representations are first separated into **two distinct sets**: those from atom nodes and those from all artificial nodes (both functional groups and the graph node). The representations within each set are aggregated separately (using summation) to yield two distinct single vectors. These two resulting vectors are then concatenated before being passed to the classification layer.
> This approach employs a finer granularity of separation, distinguishing learned representations into **three distinct sets**: atom nodes, Functional Group (FG) nodes, and the single graph node. Summation is performed separately on the atom node set and the FG node set, yielding two vectors. These two vectors are then concatenated along with the single vector corresponding to the graph node before the final linear layer.
114
+
115
+
#### GAT-specific hyperparameters
116
+
117
+
-**Number of message-passing layers**: `--model.config.num_layers=5` (default: 4)
> **Note**: GATv2 addresses the limitation of static attention in GAT by introducing a dynamic attention mechanism. For further details, please refer to the [original GATv2 paper](https://arxiv.org/abs/2105.14491).
122
+
123
+
#### **ResGated Architecture**
124
+
125
+
To use a ResGated GNN model, choose **one** of the following configs:
-**Number of final linear layers**: `--model.n_linear_layers=2` (default: 1)
137
+
138
+
## Random Node Initialization
139
+
140
+
### Static Node Initialization
141
+
142
+
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.
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 additional 45 additional features (specified by `--data.pad_node_features=45`) drawn from a normal distribution (default).
149
+
150
+
You can change the distribution from which additional are drawn by using the following config in above command: `--data.distribution=zeros`
151
+
152
+
Available distributions: `"normal", "uniform", "xavier_normal", "xavier_uniform", "zeros"`
153
+
154
+
155
+
Similarly, each edge is initialized with 7 RDKit features and 4 additional features drawn from the given distribution.
156
+
157
+
158
+
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`
159
+
160
+
161
+
Refer to the data class code for details.
162
+
163
+
164
+
### Dynamic Node Initialization
165
+
166
+
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.
167
+
168
+
169
+
170
+
Currently, dynamic node initialization is implemented only for the **resgated** architecture by specifying: `--model=../python-chebai-graph/configs/model/resgated_dynamic_gni.yml`
171
+
172
+
To keep RDKit features and *add* dynamically initialized features use the following config in the command:
173
+
174
+
```
175
+
--model.config.complete_randomness=False
176
+
--model.config.pad_node_features=45
177
+
```
178
+
179
+
The additional features are drawn from normal distribution (default). You can change it using:`--model.config.distribution=uniform`
180
+
181
+
If all features should be initialized from the given distribution, remove the complete_randomness flag (default is True).
182
+
183
+
184
+
Please find below the command for a typical dynamic node initialization:
0 commit comments