Skip to content
compressionKIT
Reference
HELIA

decoder

Decoder architectures for 1-D signal and 2-D spectrogram compression.

Machine-readable model

function

Build a configurable decoder that mirrors the encoder stages.

compressionkit/models/decoder.py:17

build_decoder_2d(
output_len: int = 2048,
out_ch: int = 1,
base: int = 32,
embedding_dim: int = 16,
multiplier: float = 1.25,
num_stages: int = 4,
decoder_block_norm: str = 'none',
head_norm: str = 'layer',
use_residual: bool = False,
activation: str = 'relu',
) -> keras.Model

Build a configurable decoder that mirrors the encoder stages.

Parameters of build_decoder_2d
NameTypeDefaultDescription
output_lenint2048Number of output time samples.
out_chint1Number of output channels.
baseint32Base filter count (mirroring the encoder).
embedding_dimint16Latent channel dimension.
multiplierfloat1.25Filter count multiplier per stage.
num_stagesint4Number of upsample stages (must match encoder).
decoder_block_normstr'none'Normalization mode for decoder blocks.
head_normstr'layer'Normalization mode for the output head.
use_residualboolFalseIf True, add shortcut connections to each stage.
activationstr'relu'Activation function for decoder blocks.
function

Decoder that mixes time with diagonal SSM blocks at every spatial scale.

compressionkit/models/decoder.py:65

build_decoder_2d_ssm(
output_len: int = 2048,
out_ch: int = 1,
base: int = 32,
embedding_dim: int = 16,
multiplier: float = 1.25,
num_stages: int = 4,
head_norm: str = 'layer',
state_size: int = 32,
num_ssm_blocks: int = 2,
max_phase: float = 3.141592653589793,
) -> keras.Model

Decoder that mixes time with diagonal SSM blocks at every spatial scale.

Drop-in shape contract for :func:build_decoder_2d: input (B, 1, output_len // 2**num_stages, embedding_dim) output (B, 1, output_len, out_ch)

function

Build a coarse + residual/detail decoder for per-level RVQ tensors.

compressionkit/models/decoder.py:134

build_hierarchical_decoder_2d(
output_len: int = 2048,
out_ch: int = 1,
base: int = 32,
embedding_dim: int = 16,
num_levels: int = 2,
multiplier: float = 1.25,
num_stages: int = 4,
decoder_block_norm: str = 'none',
head_norm: str = 'layer',
use_residual: bool = False,
activation: str = 'relu',
detail_scale: float = 0.25,
include_sum_input: bool = False,
) -> keras.Model

Build a coarse + residual/detail decoder for per-level RVQ tensors.

function

Build a summed-latent decoder with per-level residual adaptors.

compressionkit/models/decoder.py:211

build_hierarchical_adaptor_decoder_2d(
output_len: int = 2048,
out_ch: int = 1,
base: int = 32,
embedding_dim: int = 16,
num_levels: int = 2,
multiplier: float = 1.25,
num_stages: int = 4,
decoder_block_norm: str = 'none',
head_norm: str = 'layer',
use_residual: bool = False,
activation: str = 'relu',
detail_scale: float = 0.25,
) -> keras.Model

Build a summed-latent decoder with per-level residual adaptors.

function

Build a 2-D spatial decoder that mirrors the spatial encoder.

compressionkit/models/decoder.py:293

build_decoder_2d_spatial(
output_height: int,
output_width: int,
out_ch: int = 2,
base: int = 32,
embedding_dim: int = 16,
multiplier: float = 1.25,
num_stages: int = 3,
decoder_block_norm: str = 'none',
head_norm: str = 'layer',
) -> keras.Model

Build a 2-D spatial decoder that mirrors the spatial encoder.