attention.anchor_attention.config ================================= .. py:module:: attention.anchor_attention.config Classes ------- .. autoapisummary:: attention.anchor_attention.config.MultiBranchAnchorAttentionConfig attention.anchor_attention.config.CrossAchorAttentionConfig attention.anchor_attention.config.JointAnchorAttentionConfig attention.anchor_attention.config.TokenSpec attention.anchor_attention.config.AttentionPattern attention.anchor_attention.config.MixedAttentionConfig Module Contents --------------- .. py:class:: MultiBranchAnchorAttentionConfig(/, **data) Bases: :py:obj:`emmi.schemas.modules.attention.AttentionConfig` Configuration 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. .. py:attribute:: branches :type: list[str] :value: None .. py:attribute:: anchor_suffix :type: str :value: None .. py:class:: CrossAchorAttentionConfig(/, **data) Bases: :py:obj:`MultiBranchAnchorAttentionConfig` Configuration 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. .. py:class:: JointAnchorAttentionConfig(/, **data) Bases: :py:obj:`MultiBranchAnchorAttentionConfig` Configuration 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. .. py:class:: TokenSpec(/, **data) Bases: :py:obj:`pydantic.BaseModel` Specification 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. .. py:attribute:: name :type: Literal['surface_anchors', 'volume_anchors', 'surface_queries', 'volume_queries'] .. py:attribute:: size :type: int :value: None .. py:method:: from_dict(token_dict) :classmethod: Create TokenSpec from dictionary with single key-value pair. .. py:method:: to_dict() Convert TokenSpec to dictionary. .. py:class:: AttentionPattern(/, **data) Bases: :py:obj:`pydantic.BaseModel` Defines 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. .. py:attribute:: query_tokens :type: collections.abc.Sequence[str] .. py:attribute:: key_value_tokens :type: collections.abc.Sequence[str] .. py:class:: MixedAttentionConfig(/, **data) Bases: :py:obj:`emmi.schemas.modules.attention.DotProductAttentionConfig` Configuration 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.