noether.core.schemas.modules.layers

Submodules

Classes

ContinuousSincosEmbeddingConfig

Configuration for Continuous Sine-Cosine Embedding layer.

UnquantizedDropPathConfig

Configuration for the UnquantizedDropPath layer.

LayerScaleConfig

Configuration for Layer Scale module.

LinearProjectionConfig

Configuration for a LinearProjection layer.

RopeFrequencyConfig

Configuration for RoPE frequency settings.

Package Contents

class noether.core.schemas.modules.layers.ContinuousSincosEmbeddingConfig(/, **data)

Bases: pydantic.BaseModel

Configuration for Continuous Sine-Cosine Embedding layer.

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)

hidden_dim: int = None

Dimensionality of the output embedding.

input_dim: int = None

Dimensionality of the input coordinates.

max_wavelength: int = None

Maximum wavelength for the sine-cosine embeddings.

class noether.core.schemas.modules.layers.UnquantizedDropPathConfig(/, **data)

Bases: pydantic.BaseModel

Configuration for the UnquantizedDropPath layer.

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)

drop_prob: float = None

Probability of dropping a path during training.

scale_by_keep: bool = None

Up-scales activations during training by 1 - drop_prob to avoid train-test mismatch. Defaults to True.

class noether.core.schemas.modules.layers.LayerScaleConfig(/, **data)

Bases: pydantic.BaseModel

Configuration for Layer Scale module.

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)

hidden_dim: int = None

Number of dimensions of the input tensor to be scaled.

init_values: float | None = None

Initial gamme scale value. Defaults to 1e-5.

class noether.core.schemas.modules.layers.LinearProjectionConfig(/, **data)

Bases: pydantic.BaseModel

Configuration for a LinearProjection layer.

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)

input_dim: int = None

Input dimension of the linear projection.

output_dim: int = None

Output dimension of the linear projection.

ndim: None | int = None

Number of dimensions of the input domain. Either None (Linear projection), 1D (sequence), 2D, or 3D. Defaults to None.

bias: bool = None

If true, use bias term in the linear projection. Defaults to True.

optional: bool = None

If true and input_dim==output_dim (i.e., there is no up/down projection), then the identity mapping is used. Defaults to False.

init_weights: noether.core.types.InitWeightsMode = None

Initialization method of the weights of the MLP. Options are ‘torch’ (i.e., similar to the module) or ‘truncnormal002’, or ‘zero’. Defaults to ‘torch’.

validate_ndim()

Validate the ndim field to ensure it is either None, 1, 2, or 3.

Return type:

Self

class noether.core.schemas.modules.layers.RopeFrequencyConfig(/, **data)

Bases: pydantic.BaseModel

Configuration for RoPE frequency settings.

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)

hidden_dim: int = None

Dimensionality of frequencies (in transformers this should be the head dimension).

input_dim: int = None

Dimensionality of the coordinates (e.g., 2 for 2D coordinates, 3 for 3D coordinates).

max_wavelength: int = None

10000.0

Type:

Theta parameter for the transformer sine/cosine embedding. Default

implementation: Literal['real', 'complex'] = None

“real” -> basic implementation using real coordinates (this is slow and only here for backward compatibility). “complex” -> fast implementation of rotation via complex multiplication. Default: “real”.