# helia_edge.models.fastenhancer_params

Validated FastEnhancer architecture config, official presets and weight mappings; no backend imports.

## helia_edge.models.fastenhancer_params.FASTENHANCER_PRESET_SOURCE

`constant` · `python`

```python
FASTENHANCER_PRESET_SOURCE = 'aask1357/fastenhancer@e74cab157662dd0d28f381959f9b4870654d5d1f'
```

Source: `helia_edge/models/fastenhancer_params.py:88`

## helia_edge.models.fastenhancer_params.FASTENHANCER_PRESETS

`constant` · `python`

```python
FASTENHANCER_PRESETS: Mapping[str, FastEnhancerParams] = {'fastenhancer_t': FastEnhancerParams()}
```

Source: `helia_edge/models/fastenhancer_params.py:90`

## helia_edge.models.fastenhancer_params.FASTENHANCER_T_ONNX

`constant` · `python`

```python
FASTENHANCER_T_ONNX = fastenhancer_mapping(FASTENHANCER_PRESETS['fastenhancer_t'], 'fastenhancer_t_onnx', SourcePin(uri='https://github.com/aask1357/fastenhancer/releases/download/onnx-vd-v1.0.0/fastenhancer_t.spec.onnx', sha256='915a451f3b1ea8e98c20517c63b50943aa1d540624189f3106cc2e03d09634eb', format='onnx', note='onnx-vd-v1.0.0 FP32 spectral graph (VoiceBank-DEMAND, 16 kHz); code MIT.'), tensor_names={'rf_pre.0.kernel': 'onnx::MatMul_638', 'rf_block.0.rnn.W': 'onnx::GRU_662', 'rf_block.0.rnn.R': 'onnx::GRU_663', 'rf_block.0.rnn.B': 'onnx::GRU_664', 'rf_block.0.rnn_fc.kernel': 'onnx::MatMul_675', 'rf_block.0.attn.qkv.kernel': 'onnx::MatMul_680', 'rf_block.0.attn_fc.kernel': 'onnx::MatMul_702', 'rf_block.1.rnn.W': 'onnx::GRU_724', 'rf_block.1.rnn.R': 'onnx::GRU_725', 'rf_block.1.rnn.B': 'onnx::GRU_726', 'rf_block.1.rnn_fc.kernel': 'onnx::MatMul_737', 'rf_block.1.attn.qkv.kernel': 'onnx::MatMul_742', 'rf_block.1.attn_fc.kernel': 'onnx::MatMul_764', 'rf_post.0.kernel': 'onnx::MatMul_766'}, unused=('/Constant_output_0', '/Constant_1_output_0', '/Constant_2_output_0', '/Constant_3_output_0', '/Constant_4_output_0', '/Constant_6_output_0', '/Constant_7_output_0', '/Constant_8_output_0', '/rf_block.0/Constant_output_0', '/rf_block.0/Constant_1_output_0', '/rf_block.0/attn/Constant_output_0', '/rf_block.0/attn/Constant_1_output_0', '/rf_block.0/attn/Constant_3_output_0', '/rf_block.0/attn/Constant_7_output_0', '/rf_block.0/attn/Constant_11_output_0', '/Constant_14_output_0', '/Constant_17_output_0', '/enc_pre/enc_pre.0/Reshape_1_output_0', '/Concat_output_0', '/rf_block.0/attn/Sqrt_1_output_0', '/Concat_1_output_0', '/Reshape_5_output_0', '/enc_pre/enc_pre.0/Concat_1_output_0', '/enc_pre/enc_pre.0/Concat_2_output_0'))
```

Mapping of every weight of ``build(FastEnhancerParams())`` from the pinned FastEnhancer-T ONNX release; every
other initializer of the file is a graph constant, listed as unused.

Source: `helia_edge/models/fastenhancer_params.py:273`

## helia_edge.models.fastenhancer_params.MAPPINGS

`constant` · `python`

```python
MAPPINGS: dict[str, WeightMapping] = {FASTENHANCER_T_ONNX.name: FASTENHANCER_T_ONNX}
```

Weight mappings for this family, by name.

Source: `helia_edge/models/fastenhancer_params.py:330`

## helia_edge.models.fastenhancer_params.FastEnhancerRNNFormerParams

`class` · `python`

```python
FastEnhancerRNNFormerParams()
```

RNNFormer stage: per-band GRU over time, then attention across bands.

Source: `helia_edge/models/fastenhancer_params.py:12`

### helia_edge.models.fastenhancer_params.FastEnhancerRNNFormerParams.model_config

`attribute` · `python`

```python
model_config = ConfigDict(frozen=True, extra='forbid')
```

Source: `helia_edge/models/fastenhancer_params.py:15`

### helia_edge.models.fastenhancer_params.FastEnhancerRNNFormerParams.num_blocks

`attribute` · `python`

```python
num_blocks: int = Field(default=2, ge=1)
```

Source: `helia_edge/models/fastenhancer_params.py:17`

### helia_edge.models.fastenhancer_params.FastEnhancerRNNFormerParams.channels

`attribute` · `python`

```python
channels: int = Field(default=20, gt=0)
```

Source: `helia_edge/models/fastenhancer_params.py:18`

### helia_edge.models.fastenhancer_params.FastEnhancerRNNFormerParams.freq

`attribute` · `python`

```python
freq: int = Field(default=16, ge=2)
```

Source: `helia_edge/models/fastenhancer_params.py:19`

### helia_edge.models.fastenhancer_params.FastEnhancerRNNFormerParams.num_heads

`attribute` · `python`

```python
num_heads: int = Field(default=4, ge=1)
```

Source: `helia_edge/models/fastenhancer_params.py:20`

### helia_edge.models.fastenhancer_params.FastEnhancerRNNFormerParams.positional_embedding

`attribute` · `python`

```python
positional_embedding: bool = True
```

Source: `helia_edge/models/fastenhancer_params.py:21`

### helia_edge.models.fastenhancer_params.FastEnhancerRNNFormerParams.attn_bias

`attribute` · `python`

```python
attn_bias: bool = False
```

Source: `helia_edge/models/fastenhancer_params.py:22`

### helia_edge.models.fastenhancer_params.FastEnhancerRNNFormerParams.post_act

`attribute` · `python`

```python
post_act: bool = False
```

Source: `helia_edge/models/fastenhancer_params.py:23`

## helia_edge.models.fastenhancer_params.FastEnhancerParams

`class` · `python`

```python
FastEnhancerParams()
```

Folded-inference FastEnhancer config for one spectral frame per call.

BatchNorm and weight normalization are folded into biased layers, matching
the released inference graphs; this form is not the trainable architecture.
STFT/iSTFT framing belongs to the caller. Changing any field defines a new,
untrained architecture unless matching weights exist.

Source: `helia_edge/models/fastenhancer_params.py:32`

### helia_edge.models.fastenhancer_params.FastEnhancerParams.model_config

`attribute` · `python`

```python
model_config = ConfigDict(frozen=True, extra='forbid')
```

Source: `helia_edge/models/fastenhancer_params.py:41`

### helia_edge.models.fastenhancer_params.FastEnhancerParams.family

`attribute` · `python`

```python
family: Literal['fastenhancer'] = 'fastenhancer'
```

Source: `helia_edge/models/fastenhancer_params.py:43`

### helia_edge.models.fastenhancer_params.FastEnhancerParams.form

`attribute` · `python`

```python
form: Literal['folded_inference'] = 'folded_inference'
```

Source: `helia_edge/models/fastenhancer_params.py:44`

### helia_edge.models.fastenhancer_params.FastEnhancerParams.n_fft

`attribute` · `python`

```python
n_fft: int = Field(default=512, ge=4)
```

Source: `helia_edge/models/fastenhancer_params.py:45`

### helia_edge.models.fastenhancer_params.FastEnhancerParams.channels

`attribute` · `python`

```python
channels: int = Field(default=24, gt=0)
```

Source: `helia_edge/models/fastenhancer_params.py:46`

### helia_edge.models.fastenhancer_params.FastEnhancerParams.kernel_size

`attribute` · `python`

```python
kernel_size: tuple[int, ...] = (8, 3, 3)
```

Source: `helia_edge/models/fastenhancer_params.py:47`

### helia_edge.models.fastenhancer_params.FastEnhancerParams.stride

`attribute` · `python`

```python
stride: int = Field(default=4, ge=1)
```

Source: `helia_edge/models/fastenhancer_params.py:48`

### helia_edge.models.fastenhancer_params.FastEnhancerParams.rnnformer

`attribute` · `python`

```python
rnnformer: FastEnhancerRNNFormerParams = FastEnhancerRNNFormerParams()
```

Source: `helia_edge/models/fastenhancer_params.py:49`

### helia_edge.models.fastenhancer_params.FastEnhancerParams.activation

`attribute` · `python`

```python
activation: Literal['silu', 'relu'] = 'silu'
```

Source: `helia_edge/models/fastenhancer_params.py:50`

### helia_edge.models.fastenhancer_params.FastEnhancerParams.mask

`attribute` · `python`

```python
mask: Literal['none', 'sigmoid', 'tanh'] = 'none'
```

Source: `helia_edge/models/fastenhancer_params.py:51`

### helia_edge.models.fastenhancer_params.FastEnhancerParams.input_compression

`attribute` · `python`

```python
input_compression: float = Field(default=0.3, gt=0, le=1, allow_inf_nan=False)
```

Source: `helia_edge/models/fastenhancer_params.py:52`

### helia_edge.models.fastenhancer_params.FastEnhancerParams.resnet

`attribute` · `python`

```python
resnet: bool = False
```

Source: `helia_edge/models/fastenhancer_params.py:53`

### helia_edge.models.fastenhancer_params.FastEnhancerParams.spectral_bins

`attribute` · `python`

```python
spectral_bins: int
```

Spectral input/output bins, including the zero-filled Nyquist bin.

Source: `helia_edge/models/fastenhancer_params.py:73`

### helia_edge.models.fastenhancer_params.FastEnhancerParams.input_shape

`attribute` · `python`

```python
input_shape: tuple[int, ...]
```

The fixed ``spec_in`` shape ``(spectral_bins, 1, 2)``, without the batch axis.

Source: `helia_edge/models/fastenhancer_params.py:78`

### helia_edge.models.fastenhancer_params.FastEnhancerParams.encoder_bins

`attribute` · `python`

```python
encoder_bins: int
```

Frequency positions after the strided input convolution.

Source: `helia_edge/models/fastenhancer_params.py:83`

## helia_edge.models.fastenhancer_params.FastEnhancerResolvedConfig

`class` · `python`

```python
FastEnhancerResolvedConfig()
```

Serializable record of a preset, its overrides and the concrete config.

Reload from ``params``; re-resolving a preset later may differ if the
preset table changes. ``official`` is true only when the resolved config
equals the preset exactly.

Source: `helia_edge/models/fastenhancer_params.py:96`

### helia_edge.models.fastenhancer_params.FastEnhancerResolvedConfig.model_config

`attribute` · `python`

```python
model_config = ConfigDict(extra='forbid', strict=True, frozen=True)
```

Source: `helia_edge/models/fastenhancer_params.py:104`

### helia_edge.models.fastenhancer_params.FastEnhancerResolvedConfig.schema_version

`attribute` · `python`

```python
schema_version: Literal[1] = 1
```

Source: `helia_edge/models/fastenhancer_params.py:106`

### helia_edge.models.fastenhancer_params.FastEnhancerResolvedConfig.preset

`attribute` · `python`

```python
preset: str
```

Source: `helia_edge/models/fastenhancer_params.py:107`

### helia_edge.models.fastenhancer_params.FastEnhancerResolvedConfig.source

`attribute` · `python`

```python
source: str
```

Source: `helia_edge/models/fastenhancer_params.py:108`

### helia_edge.models.fastenhancer_params.FastEnhancerResolvedConfig.overrides

`attribute` · `python`

```python
overrides: dict[str, Any]
```

Source: `helia_edge/models/fastenhancer_params.py:109`

### helia_edge.models.fastenhancer_params.FastEnhancerResolvedConfig.official

`attribute` · `python`

```python
official: bool
```

Source: `helia_edge/models/fastenhancer_params.py:110`

### helia_edge.models.fastenhancer_params.FastEnhancerResolvedConfig.params

`attribute` · `python`

```python
params: FastEnhancerParams
```

Source: `helia_edge/models/fastenhancer_params.py:111`

## helia_edge.models.fastenhancer_params.resolve_fastenhancer

`function` · `python`

```python
resolve_fastenhancer(preset: str, overrides: Mapping[str, Any] | None = None) -> FastEnhancerResolvedConfig
```

Resolve an official preset with validated overrides into a full record.

Source: `helia_edge/models/fastenhancer_params.py:114`

## helia_edge.models.fastenhancer_params.fastenhancer_weight_shapes

`function` · `python`

```python
fastenhancer_weight_shapes(params: FastEnhancerParams) -> dict[str, tuple[int, ...]]
```

Folded tensors in ONNX/PyTorch layout, keyed by module path.

Conv weights are [out, in, kernel]; ``*.kernel`` MatMul weights are
[in, out]; ``rnn.W``/``rnn.R`` are [1, 3H, in] and ``rnn.B`` is [1, 6H]
with ONNX gate order z, r, h; the upsampler is [in, out, kernel].

Source: `helia_edge/models/fastenhancer_params.py:141`

## helia_edge.models.fastenhancer_params.fastenhancer_mapping

`function` · `python`

```python
fastenhancer_mapping(
    params: FastEnhancerParams,
    name: str,
    source: SourcePin,
    *,
    tensor_names: Mapping[str, str] | None = None,
    unused: tuple[str, ...] = (),
) -> WeightMapping
```

Mapping of every weight of ``build(params)`` from folded tensors in ONNX export layout.

Source tensors are keyed by module path, with the shapes ``fastenhancer_weight_shapes(params)`` lists;
each row checks its source's shape. GRU tensors must use ONNX gate order z, r, h; PyTorch ``nn.GRU``
stores r, z, n, which shapes alone cannot detect.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| params | FastEnhancerParams | Required | The params the tensors were trained with. |
| name | str | Required | Mapping name. |
| source | SourcePin | Required | The pinned source file. |
| tensor_names | Mapping[str, str] \| None | None | Source tensor names for module paths stored under another name. |
| unused | tuple[str, ...] | () | Source tensors deliberately not imported. |

**Returns**

| Name | Type | Description |
| --- | --- | --- |
| WeightMapping | WeightMapping | The mapping, for ``helia_edge.importers.import_weights``. |

**Raises**

| Name | Description |
| --- | --- |
| ValueError | If ``tensor_names`` renames a tensor these params do not have. |

Source: `helia_edge/models/fastenhancer_params.py:189`
