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.
Select the backend first
Section titled “Select the backend first”Install the matching extra from Getting started. Set the backend before importing Keras or accessing a heliaEDGE Keras component:
import osos.environ["KERAS_BACKEND"] = "tensorflow" # Use "torch" in a Torch environment.
import kerasfrom helia_edge.models import ModelSpec, build, compact_tcn_paramsUse a separate process when switching backends. See Backend support for feature-specific limits.
Configure and construct
Section titled “Configure and construct”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 PathPath("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.