noether.core.schemas.modules.attention¶
Classes¶
Configuration for an attention module. |
|
Configuration for the Dot Product attention module. |
|
Configuration for the Transolver attention module. |
|
Configuration for the Transolver++ attention module. |
|
Configuration for the Irregular Neighbourhood Attention Transformer (NAT) attention module. |
|
Configuration for the Perceiver attention module. |
|
Configuration for Multi-Branch Anchor Attention module. |
|
Configuration for Cross Anchor Attention module. |
|
Configuration for Joint Anchor Attention module. |
|
Specification for a token type in the attention mechanism. |
|
Defines which tokens attend to which other tokens. |
|
Configuration for Mixed Attention module. |
Module Contents¶
- class noether.core.schemas.modules.attention.AttentionConfig(/, **data)¶
Bases:
pydantic.BaseModelConfiguration for an attention module. Since we can have many different attention implementations, we allow extra fields. such that we can use the same schema for all attention modules.
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 an attention module.
Dimensionality of the hidden features.
- init_weights: noether.core.types.InitWeightsMode = None¶
Weight initialization strategy.
- class noether.core.schemas.modules.attention.DotProductAttentionConfig(/, **data)¶
Bases:
AttentionConfigConfiguration for the Dot Product attention 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)
- class noether.core.schemas.modules.attention.TransolverAttentionConfig(/, **data)¶
Bases:
AttentionConfigConfiguration for the Transolver attention 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)
- class noether.core.schemas.modules.attention.TransolverPlusPlusAttentionConfig(/, **data)¶
Bases:
TransolverAttentionConfigConfiguration for the Transolver++ attention 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)
- use_overparameterization: bool = None¶
Whether to use overparameterization for the slice projection.
- use_adaptive_temperature: bool = None¶
Whether to use an adaptive temperature for the slice selection.
- class noether.core.schemas.modules.attention.IrregularNatAttentionConfig(/, **data)¶
Bases:
AttentionConfigConfiguration for the Irregular Neighbourhood Attention Transformer (NAT) attention 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 dimensionality of the relative position bias MLP.
- class noether.core.schemas.modules.attention.PerceiverAttentionConfig(/, **data)¶
Bases:
AttentionConfigConfiguration for the Perceiver attention 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)
- set_kv_dim()¶
- class noether.core.schemas.modules.attention.MultiBranchAnchorAttentionConfig(/, **data)¶
Bases:
AttentionConfigConfiguration for Multi-Branch Anchor Attention 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)
- class noether.core.schemas.modules.attention.CrossAnchorAttentionConfig(/, **data)¶
Bases:
MultiBranchAnchorAttentionConfigConfiguration for Cross Anchor Attention 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)
- class noether.core.schemas.modules.attention.JointAnchorAttentionConfig(/, **data)¶
Bases:
MultiBranchAnchorAttentionConfigConfiguration for Joint Anchor Attention 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)
- class noether.core.schemas.modules.attention.TokenSpec(/, **data)¶
Bases:
pydantic.BaseModelSpecification for a token type in the attention mechanism.
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)
- name: Literal['surface_anchors', 'volume_anchors', 'surface_queries', 'volume_queries']¶
- classmethod from_dict(token_dict)¶
Create TokenSpec from dictionary with single key-value pair.
- class noether.core.schemas.modules.attention.AttentionPattern(/, **data)¶
Bases:
pydantic.BaseModelDefines which tokens attend to which other tokens.
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)
- query_tokens: collections.abc.Sequence[str]¶
- key_value_tokens: collections.abc.Sequence[str]¶
- class noether.core.schemas.modules.attention.MixedAttentionConfig(/, **data)¶
Bases:
DotProductAttentionConfigConfiguration for Mixed Attention 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)