Skip to content

Commit 97f8081

Browse files
authored
Added a dropout argument to the M3GNET constructor (#628)
The constructor simply passes the value down to the underlying M3GNetBlock layers. The default value is None (corresponding to no dropout), the same as for the M3GNetBlock layers - so there is no change to default behaviour.
1 parent 24bf236 commit 97f8081

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/matgl/models/_m3gnet.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def __init__(
8080
field: Literal["node_feat", "edge_feat"] = "node_feat",
8181
include_state: bool = False,
8282
activation_type: Literal["swish", "tanh", "sigmoid", "softplus2", "softexp"] = "swish",
83+
dropout: float | None = None,
8384
**kwargs,
8485
):
8586
"""
@@ -108,6 +109,7 @@ def __init__(
108109
nlayers_set2set (int): Number of set2set layers
109110
include_state (bool): Whether to include states features
110111
activation_type (str): Activation type. choose from 'swish', 'tanh', 'sigmoid', 'softplus2', 'softexp'
112+
dropout (float): Dropout probability to apply in graph layers during training
111113
**kwargs: For future flexibility. Not used at the moment.
112114
"""
113115
super().__init__()
@@ -174,6 +176,7 @@ def __init__(
174176
dim_edge_feats=dim_edge_embedding,
175177
dim_state_feats=dim_state_feats,
176178
include_state=include_state,
179+
dropout=dropout,
177180
)
178181
for _ in range(nblocks)
179182
}

0 commit comments

Comments
 (0)