noether.core.schemas.normalizers¶
Attributes¶
Classes¶
Base configuration for normalizers. All normalizer configs should inherit from this class. |
|
Base configuration for normalizers. All normalizer configs should inherit from this class. |
|
Base configuration for normalizers. All normalizer configs should inherit from this class. |
|
Base configuration for normalizers. All normalizer configs should inherit from this class. |
|
Declarative normalizer config that references dataset statistics by convention. |
Functions¶
Module Contents¶
- noether.core.schemas.normalizers.validate_tensor(v)¶
- Parameters:
v (Any)
- Return type:
- noether.core.schemas.normalizers.TorchTensor¶
- noether.core.schemas.normalizers.FloatOrArray¶
- noether.core.schemas.normalizers.SequenceOrTensor¶
- class noether.core.schemas.normalizers.NormalizerConfig(/, **data)¶
Bases:
noether.core.schemas.lib._RegistryBaseBase configuration for normalizers. All normalizer configs should inherit from this class.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class noether.core.schemas.normalizers.MeanStdNormalizerConfig(/, **data)¶
Bases:
NormalizerConfigBase configuration for normalizers. All normalizer configs should inherit from this class.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- kind: str | None = 'noether.data.preprocessors.normalizers.MeanStdNormalization'¶
Kind of normalizer to use, i.e. class path
- mean: TorchTensor¶
mean to subtract from the input data. Can be a single value or a Sequence if we want to apply a different mean per dimension.
- std: TorchTensor¶
standard deviation to divide the input data by. Can be a single value or a Sequence if we want to apply a different std per dimension.
- class noether.core.schemas.normalizers.PositionNormalizerConfig(/, **data)¶
Bases:
NormalizerConfigBase configuration for normalizers. All normalizer configs should inherit from this class.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- kind: str | None = 'noether.data.preprocessors.normalizers.PositionNormalizer'¶
Kind of normalizer to use, i.e. class path
- raw_pos_min: TorchTensor¶
Minimum raw position values of the entire simulation mesh. Can be a single value or a sequence of values.
- raw_pos_max: TorchTensor¶
Maximum raw position values of the entire simulation mesh. Can be a single value or a sequence of values.
- scale: float = None¶
Scaling factor, the coordinates will be scaled linearly between [0, scale]. Defaults to 1000.
- check_min_max()¶
- Return type:
Self
- class noether.core.schemas.normalizers.ShiftAndScaleNormalizerConfig(/, **data)¶
Bases:
NormalizerConfigBase configuration for normalizers. All normalizer configs should inherit from this class.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- kind: str | None = 'noether.data.preprocessors.normalizers.ShiftAndScaleNormalizer'¶
Kind of normalizer to use, i.e. class path
- shift: TorchTensor¶
Value to subtract from the input data. Can be a single value or a Sequence if we want to apply a different shift per dimension. Assumed in log scale if logscale is True.
- scale: TorchTensor¶
Value to divide the input data by. Can be a single value or a Sequence if we want to apply a different scale per dimension. Assumed in log scale if logscale is True.
- check_shift_scale()¶
- Return type:
Self
- class noether.core.schemas.normalizers.FieldNormalizerConfig(/, **data)¶
Bases:
NormalizerConfigDeclarative normalizer config that references dataset statistics by convention.
Instead of embedding numeric values (mean, std, etc.) directly, this config declares how to normalize a field. The actual statistics are resolved at runtime from the dataset’s statistics file.
For
"mean_std"normalization, the builder looks up{field}_meanand{field}_stdin the dataset statistics (customizable viastat_keys).For
"position"normalization, the builder looks upraw_pos_minandraw_pos_max(customizable viastat_keys).Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- kind: str | None = 'noether.data.preprocessors.normalizers.FieldNormalizer'¶
Kind of normalizer to use, i.e. class path
- strategy: Literal['mean_std', 'position'] = 'mean_std'¶
Normalization strategy.
"mean_std"for mean/std normalization,"position"for position normalization.
- logscale: bool = False¶
If true, the input data is converted to log scale before normalization. Only used for
"mean_std".
- noether.core.schemas.normalizers.AnyNormalizer¶