noether.core.schemas.modules.blocks¶
Classes¶
Configuration for a transformer block. |
|
Configuration for the PerceiverBlock module. |
Module Contents¶
- class noether.core.schemas.modules.blocks.TransformerBlockConfig(/, **data)¶
Bases:
pydantic.BaseModelConfiguration for a transformer block.
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 Dimension of the transformer block.
Hidden dimension of the MLP layer. If set to None, the mlp_hidden dim is set to hidden_dim * mlp_expansion_factor in the TransformerConfig. If both are None, an error is raised.
- mlp_expansion_factor: int | None = None¶
Expansion factor for the MLP hidden dimension relative to the hidden dimension. If ‘mlp_hidden_dim’ is not set, this factor is used to compute it as hidden_dim * mlp_expansion_factor.
- attention_constructor: Literal['dot_product', 'perceiver', 'transolver', 'transolver_plusplus'] = 'dot_product'¶
Constructor of the attention module. Defaults to ‘dot_product’.
- condition_dim: int | None = None¶
Dimension of the conditioning vector. If none, no conditioning is applied. If provided, the transformer block will turn into a Diffusion Transformer (DiT) block.
- init_weights: noether.core.types.InitWeightsMode = None¶
Initialization method for the weight matrices of the network. Defaults to “truncnormal002
- attention_arguments: dict¶
Additional arguments for the attention module that are only needed for a specific attention implementation.
- class noether.core.schemas.modules.blocks.PerceiverBlockConfig(/, **data)¶
Bases:
TransformerBlockConfigConfiguration for the PerceiverBlock 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)
- kv_dim: int | None = None¶
Dimensionality of the key and value representations. Defaults to None. If None, hidden_dim is used.
- set_kv_dim()¶
Set kv_dim to hidden_dim if not provided.
- Return type: