Concatenate Params Schema
Concatenate Params Schema¤
neojax.data.schemas.concatenate_params_schema.ConcatenateParamsSchema
¤
Schema that concatenates bundle parameters to the channel dimension of fields.
This is commonly used when one or multiple additional parameters are used as
model inputs next to the bundle fields (if they are not already in fields).
E.g. there is a spatially varying velocity field which was passed as parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel_axis
|
int
|
The axis index in the |
2
|
Internal Attributes
- channel_axis (
int): Axis index offieldschannel dimensions. Default is 2.
Warning
Currently only works for parameter fields, that is parameters with the same
spatial dimensions as fields. Cannot be used to concatenate parameter scalars
and fields. You need to define your own Schema for scalar parameters
(e.g. broadcast parameters over spatial dimensions as well).
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, ...]]
¤
Concatenates the parameters into the fields channel dimension.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bundle
|
Union[DataBundle, Inexact[Array, ...], Inexact[ndarray, ...]]
|
The input |
required |
reference_bundle
|
DataBundle | None
|
The original bundle, used for |
None
|
Returns:
| Type | Description |
|---|---|
Union[Inexact[Array, ...], Inexact[ndarray, ...]]
|
The modified fields array with |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
ValueError
|
If |
ValueError
|
If channel_axis is out of bounds for given fields shape. |