build_decoder_2d
PythonBuild a configurable decoder that mirrors the encoder stages.
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.ModelBuild a configurable decoder that mirrors the encoder stages.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
output_len | int | 2048 | Number of output time samples. |
out_ch | int | 1 | Number of output channels. |
base | int | 32 | Base filter count (mirroring the encoder). |
embedding_dim | int | 16 | Latent channel dimension. |
multiplier | float | 1.25 | Filter count multiplier per stage. |
num_stages | int | 4 | Number of upsample stages (must match encoder). |
decoder_block_norm | str | 'none' | Normalization mode for decoder blocks. |
head_norm | str | 'layer' | Normalization mode for the output head. |
use_residual | bool | False | If True, add shortcut connections to each stage. |
activation | str | 'relu' | Activation function for decoder blocks. |