Skip to content
heliaEDGE
Getting started
HELIA

Build your first model

Start with a small temporal convolutional network (TCN). This example constructs a model with newly initialized weights; training data and learned weights come from your application.

Install the matching extra from Getting started. Set the backend before importing Keras or accessing a heliaEDGE Keras component:

import os
os.environ["KERAS_BACKEND"] = "tensorflow" # Use "torch" in a Torch environment.
import keras
from helia_edge.models import ModelSpec, build, compact_tcn_params

Use a separate process when switching backends. See Backend support for feature-specific limits.

spec = ModelSpec(params=compact_tcn_params(filters=8, num_classes=2), input_shape=(240, 14))
model = build(spec, batch_size=1)
model.summary()

The input represents 240 time steps and 14 channels per example. Those dimensions and the two output classes are choices for this example, not fixed requirements of the preset. Choose dimensions and an output interpretation that match your task.

With this preset, the output shape is (1, 240, 2): two logits per time step. It is a sequence output, not one classification for the entire window.

The spec (family parameters and input shape) describes the architecture. The constructed Keras model holds its layers and weights. Keep both when recording an experiment:

from pathlib import Path
Path("architecture.json").write_text(spec.model_dump_json(indent=2))
model.save("model.keras")

This saves an initialized, untrained model. Training, data splits, objectives and evaluation remain application decisions.