TransformerTemporalModel¶
A Transformer model for video-like data.
mindone.diffusers.models.transformers.transformer_temporal.TransformerTemporalModel
¶
Bases: ModelMixin
, ConfigMixin
A Transformer model for video-like data.
PARAMETER | DESCRIPTION |
---|---|
num_attention_heads |
The number of heads to use for multi-head attention.
TYPE:
|
attention_head_dim |
The number of channels in each head.
TYPE:
|
in_channels |
The number of channels in the input and output (specify if the input is continuous).
TYPE:
|
num_layers |
The number of layers of Transformer blocks to use.
TYPE:
|
dropout |
The dropout probability to use.
TYPE:
|
cross_attention_dim |
The number of
TYPE:
|
attention_bias |
Configure if the
TYPE:
|
sample_size |
The width of the latent images (specify if the input is discrete). This is fixed during training since it is used to learn a number of position embeddings.
TYPE:
|
activation_fn |
Activation function to use in feed-forward. See
TYPE:
|
norm_elementwise_affine |
Configure if the
TYPE:
|
double_self_attention |
Configure if each
TYPE:
|
positional_embeddings |
(
TYPE:
|
num_positional_embeddings |
(
TYPE:
|
Source code in mindone/diffusers/models/transformers/transformer_temporal.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 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 98 99 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 135 136 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 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
|
mindone.diffusers.models.transformers.transformer_temporal.TransformerTemporalModel.construct(hidden_states, encoder_hidden_states=None, timestep=None, class_labels=None, num_frames=1, cross_attention_kwargs=None, return_dict=False)
¶
The [TransformerTemporal
] forward method.
PARAMETER | DESCRIPTION |
---|---|
`ms.Tensor` |
Input hidden_states.
TYPE:
|
encoder_hidden_states |
Conditional embeddings for cross attention layer. If not given, cross-attention defaults to self-attention.
TYPE:
|
timestep |
Used to indicate denoising step. Optional timestep to be applied as an embedding in
TYPE:
|
class_labels |
Used to indicate class labels conditioning. Optional class labels to be applied as an embedding in
TYPE:
|
num_frames |
The number of frames to be processed per batch. This is used to reshape the hidden states.
TYPE:
|
cross_attention_kwargs |
A kwargs dictionary that if specified is passed along to the
TYPE:
|
return_dict |
Whether or not to return a [
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
TransformerTemporalModelOutput
|
[ |
Source code in mindone/diffusers/models/transformers/transformer_temporal.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 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 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
|
mindone.diffusers.models.transformers.transformer_temporal.TransformerTemporalModelOutput
dataclass
¶
Bases: BaseOutput
The output of [TransformerTemporalModel
].
PARAMETER | DESCRIPTION |
---|---|
sample |
The hidden states output conditioned on
TYPE:
|
Source code in mindone/diffusers/models/transformers/transformer_temporal.py
29 30 31 32 33 34 35 36 37 38 39 |
|