modeling_outputs - MultiMolecule
Author: MultiMolecule
Description: Neural Networks for RNA, DNA, and Protein

跳转至

# modeling_outputs

## `` multimolecule.models.modeling_outputs

### `` ContactPredictorOutput `dataclass`

Bases: `ModelOutput`

Base class for outputs of contact classification & regression models.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`loss` | `FloatTensor | None` | `torch.FloatTensor` of shape `(1,)`. Optional, returned when `labels` is provided | `None`
`logits` | `FloatTensor` | `torch.FloatTensor` of shape `(batch_size, sequence_length, config.num_labels)` Prediction outputs. | `None`
`hidden_states` | `Tuple[FloatTensor, ...] | None` | Tuple of `torch.FloatTensor` (one for the output of the embeddings, if the model has an embedding layer, + one for the output of each layer) of shape `(batch_size, sequence_length, hidden_size)`. Optional, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True Hidden-states of the model at the output of each layer plus the optional initial embedding outputs. | `None`
`attentions` | `Tuple[FloatTensor, ...] | None` | Tuple of `torch.FloatTensor` (one for each layer) of shape `(batch_size, num_heads, sequence_length, sequence_length)`. Optional, eturned when `output_attentions=True` is passed or when `config.output_attentions=True` Attentions weights after the attention softmax, used to compute the weighted average in the self-attention heads. | `None`

Source code in `multimolecule/models/modeling_outputs.py`

Python
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    @dataclass
    class ContactPredictorOutput(ModelOutput):
        """
        Base class for outputs of contact classification & regression models.

        Args:
            loss:
                `torch.FloatTensor` of shape `(1,)`.

                Optional, returned when `labels` is provided
            logits:
                `torch.FloatTensor` of shape `(batch_size, sequence_length, config.num_labels)`

                Prediction outputs.
            hidden_states:
                Tuple of `torch.FloatTensor` (one for the output of the embeddings, if the model has an embedding layer, +
                one for the output of each layer) of shape `(batch_size, sequence_length, hidden_size)`.

                Optional, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True

                Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.
            attentions:
                Tuple of `torch.FloatTensor` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
                sequence_length)`.

                Optional, eturned when `output_attentions=True` is passed or when `config.output_attentions=True`

                Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
                heads.
        """

        loss: torch.FloatTensor | None = None
        logits: torch.FloatTensor = None
        hidden_states: Tuple[torch.FloatTensor, ...] | None = None
        attentions: Tuple[torch.FloatTensor, ...] | None = None

### `` NucleotidePredictorOutput `dataclass`

Bases: `ModelOutput`

Base class for outputs of nucleotide classification & regression models.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`loss` | `FloatTensor | None` | `torch.FloatTensor` of shape `(1,)`. Optional, returned when `labels` is provided | `None`
`logits` | `FloatTensor` | `torch.FloatTensor` of shape `(batch_size, sequence_length, config.num_labels)` Prediction outputs. | `None`
`hidden_states` | `Tuple[FloatTensor, ...] | None` | Tuple of `torch.FloatTensor` (one for the output of the embeddings, if the model has an embedding layer, + one for the output of each layer) of shape `(batch_size, sequence_length, hidden_size)`. Optional, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True Hidden-states of the model at the output of each layer plus the optional initial embedding outputs. | `None`
`attentions` | `Tuple[FloatTensor, ...] | None` | Tuple of `torch.FloatTensor` (one for each layer) of shape `(batch_size, num_heads, sequence_length, sequence_length)`. Optional, eturned when `output_attentions=True` is passed or when `config.output_attentions=True` Attentions weights after the attention softmax, used to compute the weighted average in the self-attention heads. | `None`

Source code in `multimolecule/models/modeling_outputs.py`

Python
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    @dataclass
    class NucleotidePredictorOutput(ModelOutput):
        """
        Base class for outputs of nucleotide classification & regression models.

        Args:
            loss:
                `torch.FloatTensor` of shape `(1,)`.

                Optional, returned when `labels` is provided
            logits:
                `torch.FloatTensor` of shape `(batch_size, sequence_length, config.num_labels)`

                Prediction outputs.
            hidden_states:
                Tuple of `torch.FloatTensor` (one for the output of the embeddings, if the model has an embedding layer, +
                one for the output of each layer) of shape `(batch_size, sequence_length, hidden_size)`.

                Optional, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True

                Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.
            attentions:
                Tuple of `torch.FloatTensor` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
                sequence_length)`.

                Optional, eturned when `output_attentions=True` is passed or when `config.output_attentions=True`

                Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
                heads.
        """

        loss: torch.FloatTensor | None = None
        logits: torch.FloatTensor = None
        hidden_states: Tuple[torch.FloatTensor, ...] | None = None
        attentions: Tuple[torch.FloatTensor, ...] | None = None

### `` SequencePredictorOutput `dataclass`

Bases: `ModelOutput`

Base class for outputs of sentence classification & regression models.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`loss` | `FloatTensor | None` | `torch.FloatTensor` of shape `(1,)`. Optional, returned when `labels` is provided | `None`
`logits` | `FloatTensor` | `torch.FloatTensor` of shape `(batch_size, sequence_length, config.num_labels)` Prediction outputs. | `None`
`hidden_states` | `Tuple[FloatTensor, ...] | None` | Tuple of `torch.FloatTensor` (one for the output of the embeddings, if the model has an embedding layer, + one for the output of each layer) of shape `(batch_size, sequence_length, hidden_size)`. Optional, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True Hidden-states of the model at the output of each layer plus the optional initial embedding outputs. | `None`
`attentions` | `Tuple[FloatTensor, ...] | None` | Tuple of `torch.FloatTensor` (one for each layer) of shape `(batch_size, num_heads, sequence_length, sequence_length)`. Optional, eturned when `output_attentions=True` is passed or when `config.output_attentions=True` Attentions weights after the attention softmax, used to compute the weighted average in the self-attention heads. | `None`

Source code in `multimolecule/models/modeling_outputs.py`

Python
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    @dataclass
    class SequencePredictorOutput(ModelOutput):
        """
        Base class for outputs of sentence classification & regression models.

        Args:
            loss:
                `torch.FloatTensor` of shape `(1,)`.

                Optional, returned when `labels` is provided
            logits:
                `torch.FloatTensor` of shape `(batch_size, sequence_length, config.num_labels)`

                Prediction outputs.
            hidden_states:
                Tuple of `torch.FloatTensor` (one for the output of the embeddings, if the model has an embedding layer, +
                one for the output of each layer) of shape `(batch_size, sequence_length, hidden_size)`.

                Optional, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True

                Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.
            attentions:
                Tuple of `torch.FloatTensor` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
                sequence_length)`.

                Optional, eturned when `output_attentions=True` is passed or when `config.output_attentions=True`

                Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
                heads.
        """

        loss: torch.FloatTensor | None = None
        logits: torch.FloatTensor = None
        hidden_states: Tuple[torch.FloatTensor, ...] | None = None
        attentions: Tuple[torch.FloatTensor, ...] | None = None

### `` TokenPredictorOutput `dataclass`

Bases: `ModelOutput`

Base class for outputs of token classification & regression models.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`loss` | `FloatTensor | None` | `torch.FloatTensor` of shape `(1,)`. Optional, returned when `labels` is provided | `None`
`logits` | `FloatTensor` | `torch.FloatTensor` of shape `(batch_size, sequence_length, config.num_labels)` Prediction outputs. | `None`
`hidden_states` | `Tuple[FloatTensor, ...] | None` | Tuple of `torch.FloatTensor` (one for the output of the embeddings, if the model has an embedding layer, + one for the output of each layer) of shape `(batch_size, sequence_length, hidden_size)`. Optional, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True Hidden-states of the model at the output of each layer plus the optional initial embedding outputs. | `None`
`attentions` | `Tuple[FloatTensor, ...] | None` | Tuple of `torch.FloatTensor` (one for each layer) of shape `(batch_size, num_heads, sequence_length, sequence_length)`. Optional, eturned when `output_attentions=True` is passed or when `config.output_attentions=True` Attentions weights after the attention softmax, used to compute the weighted average in the self-attention heads. | `None`

Source code in `multimolecule/models/modeling_outputs.py`

Python
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    @dataclass
    class TokenPredictorOutput(ModelOutput):
        """
        Base class for outputs of token classification & regression models.

        Args:
            loss:
                `torch.FloatTensor` of shape `(1,)`.

                Optional, returned when `labels` is provided
            logits:
                `torch.FloatTensor` of shape `(batch_size, sequence_length, config.num_labels)`

                Prediction outputs.
            hidden_states:
                Tuple of `torch.FloatTensor` (one for the output of the embeddings, if the model has an embedding layer, +
                one for the output of each layer) of shape `(batch_size, sequence_length, hidden_size)`.

                Optional, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True

                Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.
            attentions:
                Tuple of `torch.FloatTensor` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
                sequence_length)`.

                Optional, eturned when `output_attentions=True` is passed or when `config.output_attentions=True`

                Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
                heads.
        """

        loss: torch.FloatTensor | None = None
        logits: torch.FloatTensor = None
        hidden_states: Tuple[torch.FloatTensor, ...] | None = None
        attentions: Tuple[torch.FloatTensor, ...] | None = None

2024-06-04 08:00:37

#### Cookie Consent

We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better. Please check out our Privacy Notice for more information.

- Google Analytics
- GitHub

管理设定