Full3DAttention<T>

Models & Types · AiDotNet.Diffusion.Attention

Full 3D attention across all spatio-temporal positions simultaneously.

Inheritance: LayerBase<T> → Full3DAttention<T>

Implements: IShapeContract

For Beginners

Full 3D Attention jointly attends to all spatial and temporal positions simultaneously. While computationally expensive, it captures the richest interactions between space and time for highest quality results.

How It Works

References:

  • Paper: “Sora: Creating video from text” (OpenAI, 2024)
  • Paper: “MovieGen: A Cast of Media Foundation Models” (Meta, 2024)

Full 3D attention computes attention across all tokens in the video volume simultaneously (all frames, all spatial positions). While computationally expensive at O((THW)^2), it captures the richest spatio-temporal interactions and is used in the most capable video generation models like Sora and MovieGen.

Architecture:

  • Flattens all frames and spatial positions into a single sequence
  • Applies multi-head self-attention across the entire video volume
  • Uses Flash Attention for memory efficiency
  • Uses Flash Attention implementation for O(N) memory

Constructors

Constructor Summary
Full3DAttention(int channels, int numHeads, int numFrames, int spatialSize) Initializes a new full 3D attention layer.

Properties

Property Summary
bool SupportsTraining { get; }
int Channels { get; } Gets the number of channels.
int TotalSequenceLength { get; } Gets the total sequence length (frames * height * width).

Methods

Method Summary
IReadOnlyList<ILayer<T>> GetSubLayers()
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank) Derived from this type’s [TensorLayout] declarations.
void ResetState()
void UpdateParameters(T learningRate)