- class openff.nagl.nn.gcn.BaseGCNStack(*args, _is_dgl: bool = False, **kwargs)[source]
Bases:
ModuleList
,Generic
[GCNLayerType
],ContainsLayersMixin
,ABC
A wrapper around a stack of GCN graph convolutional layers.
- Note:
This class is based on the
dgllife.model.SAGEConv
module.
Methods
Add a new layer to the stack.
Create a new GCN layer.
Update node representations.
Reinitialize model parameters.
Create this model with layers with the specified parameters.
Attributes
The aggregator options to use for the GCN layers.
The aggregator options to use for the GCN layers.
The aggregator options to use for the GCN layers.
The aggregator options to use for the GCN layers.
training
- append_gcn_layer(n_output_features: int, n_input_features: int | None = None, aggregator_type: str | None = None, dropout: float | None = None, activation_function: ActivationFunction | None = None)[source]
Add a new layer to the stack.
- classmethod create_gcn_layer(n_input_features: int, n_output_features: int, aggregator_type: str | None = None, dropout: float | None = None, activation_function: ActivationFunction | None = None, **kwargs) GCNLayerType [source]
Create a new GCN layer.
- forward(graph, inputs: Tensor) Tensor [source]
Update node representations.
- Args:
graph: The batch of graphs to operate on. inputs: The inputs to the layers with shape=(n_nodes, in_feats).
- Returns
The output hidden features with shape=(n_nodes, hidden_feats[-1]).
- reset_parameters()[source]
Reinitialize model parameters.
- classmethod with_layers(n_input_features: int, hidden_feature_sizes: List[int], layer_activation_functions: List[ActivationFunction] | None = None, layer_dropout: List[float] | None = None, layer_aggregator_types: List[str] | None = None)[source]
Create this model with layers with the specified parameters.