Skip to content
heliaEDGE
Reference
HELIA

spec

The model spec: one serializable identity per architecture, and the single builder; importable without Keras.

A ModelSpec is the typed Params of one family (selected by its family field) and the input shape without the batch axis. build(spec) builds it. Families are a closed set: each has a Keras-free <family>_params.py and a build(params, input_shape, *, batch_size=None, name=None) in its model module.

Machine-readable model

  • ModelParamsattributeThe Params of any family, discriminated by family.
  • FIXED_INPUTconstantFamilies whose input shape follows from their Params (params.inputshape); their inputshape may be None.
  • ModelSpecclassThe serializable identity of an architecture.
  • buildfunctionBuild the model a spec describes.
attribute

The Params of any family, discriminated by family.

helia_edge/models/spec.py:35

ModelParams = Annotated[ComposerParams | ConformerParams | ConvMixerParams | CorNetParams | EfficientNetParams | FastEnhancerParams | MetaFormerParams | MiniResNetV1Params | MlperfTinyParams | MobileNetV1Params | MobileOneParams | RegNetParams | ResNetParams | SileroVadParams | TcnParams | TimePPGParams | TsMixerParams | UNetParams | UNextParams, Field(discriminator='family')]

The Params of any family, discriminated by family.

constant

Families whose input shape follows from their Params (params.inputshape); their inputshape may be None.

helia_edge/models/spec.py:59

FIXED_INPUT = (FastEnhancerParams, MlperfTinyParams, SileroVadParams)

Families whose input shape follows from their Params (params.input_shape); their input_shape may be None.

class

ModelSpec

Python

The serializable identity of an architecture.

helia_edge/models/spec.py:63

ModelSpec()

The serializable identity of an architecture.

attribute

helia_edge/models/spec.py:75

input_shape: tuple[int | None, ...] | None = None

Input shape without the batch axis; None for a variable axis. None for the families in FIXED_INPUT, whose shape follows from their Params.

function

build

Python

Build the model a spec describes.

helia_edge/models/spec.py:89

build(spec: ModelSpec, *, batch_size: int | None = None, name: str | None = None) -> keras.Model

Build the model a spec describes.

Parameters of build
NameTypeDefaultDescription
specModelSpecRequiredFamily Params and input shape.
batch_sizeint | NoneNoneStatic batch size; None for a dynamic batch.
namestr | NoneNoneModel name; the family when None. Give distinct names to combine two models of one family in a Keras graph.
Returns of build
TypeDescription
keras.Modelkeras.Model: The model.