Skip to content
heliaEDGE
Reference
HELIA

fastenhancer

FastEnhancer folded-inference model for streaming spectral enhancement.

Adapted from aask1357/fastenhancer (revision e74cab1, models/fastenhancer/ default/model.py), the revision of the onnx-vd-v1.0.0 release. One call processes one STFT frame: spec_in is (n_fft // 2 + 1, 1, 2) real/imag, and each RNNFormer block carries a GRU state (freq, channels). Callers zero the states only at independent sequence starts and feed each state_out_k back as state_in_k. The graph matches the released ONNX inference form, with BatchNorm and weight normalization folded. STFT/iSTFT framing, weight files and weight terms are the caller’s concern.

Machine-readable model

function

Return fixed triangular (pre, post) frequency projections as [in, out] kernels.

helia_edge/models/fastenhancer.py:22

linear_filterbanks(n_freq: int, n_filter: int) -> tuple[np.ndarray, np.ndarray]

Return fixed triangular (pre, post) frequency projections as [in, out] kernels.

Follows upstream revision e74cab1, which produced the onnx-vd-v1.0.0 weights; upstream changed this formula in 8d2d419 (2026-02-25).

class

Project the frequency axis of (batch, freq, channels) with a [in, out] kernel.

helia_edge/models/fastenhancer.py:79

FastEnhancerFrequencyProjection(units: int, **kwargs={})

Project the frequency axis of (batch, freq, channels) with a [in, out] kernel.

class

One GRU step per frequency band, gates z, r, h and reset after matmul.

helia_edge/models/fastenhancer.py:97

FastEnhancerGRUStep(units: int, **kwargs={})

One GRU step per frequency band, gates z, r, h and reset after matmul.

Matches ONNX GRU with linear_before_reset=1 and PyTorch nn.GRU: h’ = z * h + (1 - z) * tanh(Wx + bw + r * (Rh + br)). Returns h’.

class

Multi-head self-attention across frequency bands, no output projection.

helia_edge/models/fastenhancer.py:143

FastEnhancerFrequencyAttention(num_heads: int, use_bias: bool = False, **kwargs={})

Multi-head self-attention across frequency bands, no output projection.

The qkv kernel is [channels, 3 * channels] with per-head interleaved columns: head h uses q = 3dh*h + [0, dh), k = + [dh, 2dh), v = + [2dh, 3dh).

function

build

Python

Construct an untrained one-frame FastEnhancer with named streaming inputs and outputs.

helia_edge/models/fastenhancer.py:187

build(
params: FastEnhancerParams,
input_shape: tuple[int | None, ...] | None = None,
*,
batch_size: int | None = None,
name: str | None = None,
) -> keras.Model

Construct an untrained one-frame FastEnhancer with named streaming inputs and outputs.

Inputs: spec_in (bins, 1, 2) and state_in_k (freq, channels) per block. Outputs: spec_out and state_out_k. Fixed linear filterbanks are initialized and frozen; other weights are untrained until imported with a mapping from fastenhancer_params (FASTENHANCER_T_ONNX or fastenhancer_mapping).

Parameters of build
NameTypeDefaultDescription
paramsFastEnhancerParamsRequiredModel parameters.
input_shapetuple[int | None, ...] | NoneNoneNone, or ``spec_in``'s fixed shape ``(bins, 1, 2)``.
batch_sizeint | NoneNoneStatic batch size; None for a dynamic batch.
namestr | NoneNoneModel name; the family when None.
Returns of build
TypeDescription
keras.Modelkeras.Model: The model, named ``fastenhancer`` unless ``name`` is given.