phlower.nn.MLP

class phlower.nn.MLP(nodes, activations=None, dropouts=None, bias=True)[source]

Bases: IPhlowerCoreModule, Module

Multi Layer Perceptron

Methods

forward(data, *[, field_data, supports])

forward function which overloads torch.nn.Module

from_setting(setting)

Generate MLP from setting object

get_nn_name()

Return neural network name

Attributes

T_destination

call_super_init

dump_patches

training

Parameters:
  • nodes (list[int])

  • activations (list[str] | None)

  • dropouts (list[float] | None)

  • bias (bool)

forward(data, *, field_data=None, supports=None, **kwards)[source]

forward function which overloads torch.nn.Module

Parameters:
  • data (IPhlowerTensorCollections) – data which receives from predecessors

  • supports (dict[str, PhlowerTensor], optional) – Graph object. Defaults to None.

  • field_data (ISimulationField | None)

Returns:

Tensor object

Return type:

PhlowerTensor

classmethod from_setting(setting)[source]

Generate MLP from setting object

Parameters:

setting (MLPSetting) – setting object

Returns:

MLP object

Return type:

Self

classmethod get_nn_name()[source]

Return neural network name

Returns:

name

Return type:

str