phlower.nn.TimeSeriesToFeatures

class phlower.nn.TimeSeriesToFeatures(nodes=None, activation='identity')[source]

Bases: IPhlowerCoreModule, Module

TimeSeriesToFeatures is a neural network module that converts a time series tensor into a non time series tensor by summing the time series tensor along the time dimension.

Parameters:
  • nodes (list[int]) – List of feature dimension sizes (The last value of tensor shape).

  • activation (str) – Activation function to apply to the output.

Examples

>>> time_series_to_features = TimeSeriesToFeatures(
...     nodes=[10, 20, 30],
...     activation="relu",
... )
>>> time_series_to_features(data)

Methods

forward(data, *[, field_data])

forward function which overloads torch.nn.Module

from_setting(setting)

Create TimeSeriesToFeatures from setting object

get_nn_name()

Return name of TimeSeriesToFeatures

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 predecessor

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

Returns:

Tensor object

Return type:

PhlowerTensor

classmethod from_setting(setting)[source]

Create TimeSeriesToFeatures from setting object

Parameters:

setting (TimeSeriesToFeaturesSetting) – setting object

Returns:

TimeSeriesToFeatures

Return type:

Self

classmethod get_nn_name()[source]

Return name of TimeSeriesToFeatures

Returns:

name

Return type:

str