phlower.nn.GCNΒΆ
- class phlower.nn.GCN(nodes, support_name, activations=None, dropouts=None, repeat=1, factor=1.0, bias=True)[source]ΒΆ
Bases:
IPhlowerCoreModule
,Module
GCN is a neural network module that performs a graph convolution operation on the input tensor.
- Parameters:
nodes (list[int]) β List of feature dimension sizes (The last value of tensor shape).
support_name (str) β Name of the support tensor.
activations (list[str] | None (optional)) β List of activation functions to apply to the output. Defaults to None.
dropouts (list[float] | None (optional)) β List of dropout rates to apply to the output. Defaults to None.
repeat (int) β Number of times to repeat the operation.
factor (float) β Factor to multiply the support tensor by.
bias (bool) β Whether to use bias.
Examples
>>> gcn = GCN( ... nodes=[10, 20, 30], ... support_name="support", ... activations=["relu", "relu", "relu"], ... dropouts=[0.1, 0.1, 0.1], ... repeat=1, ... factor=1.0, ... bias=True ...) >>> gcn(data)
Methods
forward
(data, *, field_data, **kwards)forward function which overload torch.nn.Module
from_setting
(setting)Create GCN from GCNSetting instance
Return neural network name
Attributes
T_destination
call_super_init
dump_patches
training
- forward(data, *, field_data, **kwards)[source]ΒΆ
forward function which overload torch.nn.Module
- Parameters:
data (IPhlowerTensorCollections) β IPhlowerTensorCollections data which receives from predecessors
field_data (ISimulationField) β ISimulationField | None Constant information through training or prediction
- Returns:
Tensor object
- Return type: