Skip to content

Flatten Time Schema

Flatten Time Schema¤

neojax.data.schemas.flatten_time_schema.FlattenTimeSchema ¤

Schema that flattens multiple time steps into the channel dimension.

Often used for models predicting the next time step from a history of past time steps by stacking the past states as channels.

Parameters:

Name Type Description Default
time_axis int

The axis index in the fields array corresponding to time. Defaults to 1.

1
channel_axis int

The axis index corresponding to the channel dimension. Defaults to 2.

2
Internal Attributes
  • time_axis (int): Axis index of time dimensions.
  • channel_axis (int): Axis index of channel dimensions.
transform(bundle: typing.Union[neojax.data.bundles.data_bundle.DataBundle, Inexact[Array, ...], Inexact[ndarray, ...]], /, reference_bundle: neojax.data.bundles.data_bundle.DataBundle | None = None) -> typing.Union[Inexact[Array, ...], Inexact[ndarray, ...]] ¤

Flattens time into channels.

Parameters:

Name Type Description Default
bundle Union[DataBundle, Inexact[Array, ...], Inexact[ndarray, ...]]

The DataBundle or array.

required
reference_bundle DataBundle | None

Ignored. Kept for API compatibility.

None

Returns:

Type Description
Union[Inexact[Array, ...], Inexact[ndarray, ...]]

The array with the time dimension folded into the channel dimension.