phlower.nn.Dirichlet¶
- class phlower.nn.Dirichlet(activation, dirichlet_name, nodes=None)[source]¶
Bases:
IPhlowerCoreModule
,Module
Dirichlet is a neural network module that overwrites values with that of dirichlet field.
- Parameters:
activation (str) – Name of the activation function to apply to the output.
dirichlet_name (str) – Name of the dirichlet field.
nodes (list[int] | None (optional)) – List of feature dimension sizes (The last value of tensor shape). Defaults to None.
Examples
>>> dirichlet = Dirichlet(activation="relu", dirichlet_name="dirichlet") >>> dirichlet(data)
Methods
forward
(data, *[, field_data])forward function which overloads torch.nn.Module
from_setting
(setting)Create Dirichlet from setting object
Return name of Dirichlet
Attributes
T_destination
call_super_init
dump_patches
training
- forward(data, *, field_data=None, **kwards)[source]¶
forward function which overloads torch.nn.Module
- Parameters:
data (IPhlowerTensorCollections) – IPhlowerTensorCollections data which receives from predecessors
supports – dict[str, PhlowerTensor] | None Graph object. Defaults to None. Dirichlet will not use it.
field_data (ISimulationField | None)
- Returns:
Tensor object
- Return type: