phlower.nn.Identity

class phlower.nn.Identity(nodes=None)[source]

Bases: IPhlowerCoreModule, Module

Identity is a neural network module that returns the input tensor.

Parameters:

nodes (list[int] | None (optional)) – List of feature dimension sizes (The last value of tensor shape). Defaults to None.

Examples

>>> identity = Identity()
>>> identity(data) # return data itself

Methods

forward(data, *[, field_data])

forward function which overloads torch.nn.Module

from_setting(setting)

Generate model from setting object

get_nn_name()

Return neural network name

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

  • field_data (ISimulationField | None) – ISimulationField | None Constant information through training or prediction

Returns:

Tensor object

Return type:

PhlowerTensor

classmethod from_setting(setting)[source]

Generate model from setting object

Parameters:

setting (IdentitySetting) – IdentitySettin setting object

Returns:

Identity object

Return type:

Self

classmethod get_nn_name()[source]

Return neural network name

Returns:

name

Return type:

str