Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Facebookresearch Audiocraft UnetTransformer

From Leeroopedia
Revision as of 12:33, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Facebookresearch_Audiocraft_UnetTransformer.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Transformer, Model_Architecture
Last Updated 2026-02-14 01:00 GMT

Overview

Concrete tool for extending StreamingTransformer with U-Net-style skip connections between encoder and decoder halves.

Description

StreamingTransformerUnet extends StreamingTransformer by adding linear skip connections between the first half and second half of the transformer layers. Activations from layer i are projected and added to activations at the corresponding decoder layer (num_layers - 1 - i). This is used in diffusion U-Net models.

Usage

Import this class when building diffusion models that need transformer blocks with skip connections.

Code Reference

Source Location

Signature

class StreamingTransformerUnet(StreamingTransformer):
    def forward(self, x, *args, **kwargs): ...

Import

from audiocraft.modules.unet_transformer import StreamingTransformerUnet

I/O Contract

Inputs

Name Type Required Description
x torch.Tensor Yes Input tensor [B, T, D]

Outputs

Name Type Description
output torch.Tensor Transformer output with skip connections [B, T, D]

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment