blocks.transformer_block_config¶
Classes¶
Configuration for a transformer block. |
Module Contents¶
- class blocks.transformer_block_config.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.
- 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: emmi.types.InitWeightsMode = None¶
Initialization method for the weight matrixes of the network. Defaults to “truncnormal002
- attention_arguments: dict¶
Additional arguments for the attention module that are only needed for a specific attention impelentation.