Physics Normalizer
Physics Normalizer¤
(Non-dimensionalizes data using physical scales. See Scales Reference.)
neojax.data.normalizers.physics_normalizer.PhysicsNormalizer
¤
Normalizes data based on spatial dimensions/physical units.
This normalizer applies a product of multiple PhysicalScale factors
to non-dimensionalize the input data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*scales
|
PhysicalScale
|
Variable number of |
required |
Internal Attributes
These fields store the internal state of the normalizer.
- scales (
tuple[PhysicalScale, ...]): Tuple of physical scale providers. - stats (
dict[str, Float[Array, ...] | None]): Dict containing 'scale_product', which is the resulting element-wise product of all computed scales.
Examples:
from neojax.data.scales import CharacteristicLengthScale, ReynoldsScale
from neojax.data.normalizers import PhysicsNormalizer
# Compose multiple physical scales
norm = PhysicsNormalizer(
CharacteristicLengthScale(L_ref=1.0),
ReynoldsScale(U=10.0, L=1.0, nu=1e-3)
)
# Compute and apply
norm = norm.compute_stats(data)
non_dimensional = norm(data)
compute_stats(data: Float[Array, 'c ...'], axis: int | tuple[int, ...] | None = None) -> PhysicsNormalizer
¤
Computes the product of all scales for the given data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Float[Array, 'c ...']
|
The input array to compute statistics from. |
required |
axis
|
int | tuple[int, ...] | None
|
Unused for physics-based scaling but kept for API compatibility. |
None
|
Returns:
| Type | Description |
|---|---|
PhysicsNormalizer
|
A new PhysicsNormalizer instance with the final computed
scale product in |
transform(x: Float[Array, ...]) -> Float[Array, ...]
¤
Non-dimensionalizes input by dividing by the scale product.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Float[Array, ...]
|
The input array to transform. |
required |
Returns:
| Type | Description |
|---|---|
Float[Array, ...]
|
The non-dimensionalized array. |
inverse_transform(x: Float[Array, ...]) -> Float[Array, ...]
¤
Reverts non-dimensionalization by multiplying by the scale product.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Float[Array, ...]
|
The transformed array to revert. |
required |
Returns:
| Type | Description |
|---|---|
Float[Array, ...]
|
The array in physical units. |
__call__(x: Float[Array, ...]) -> Float[Array, ...]
¤
Standardizes input using the computed physical scale product.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Float[Array, ...]
|
Input array. |
required |
Returns:
| Type | Description |
|---|---|
Float[Array, ...]
|
Normalized input array. |