Skip to content
heliaEDGE
Reference
HELIA

Python API catalog

Find a class or function by name, description or module. Filter by category to explore a part of the toolkit. Signatures and parameter documentation are generated from the source tree at build time.

Use Import surface to distinguish package exports (such as helia_edge.metrics.ConfusionMatrix) from APIs defined in individual modules. Public import paths are searchable. Class pages link inherited methods to their defining class.

Backend support varies by component. Read the backend support guide before choosing a TensorFlow or PyTorch workflow.

322 of 322 APIs

Search Python API
NameDescription
AddSineWaveAugmentationAdd a fixed sine wave in training and inference.
AmplitudeWarpAugmentationApply amplitude warping to the 1D input.
append_layersArchitecturesAppends layers to a model by cloning it and adding the layers.
att_blockArchitecturesAttention block
attention_token_mixerArchitecturesToken mixer using multi-head attention
AugmentationPipelineAugmentationApply layers in order to a tensor or structured sample.
BackendUnavailableConversionThe active Keras backend cannot export: LiteRT export needs the TensorFlow backend.
BaseAugmentationAugmentationBase for rank-specific transforms, with one sampling/application contract.
BaseAugmentation1DAugmentationOne-dimensional signals with optional batch axis.
BaseAugmentation2DAugmentationTwo-dimensional images with optional batch axis.
BaseAugmentationParamsAugmentationShared construction-time configuration; never validates live tensors.
batch_normalizationLayersBatch normalization
buildArchitecturesBuild a Composer model.
buildArchitecturesBuild a Conformer model.
buildArchitecturesBuild a ConvMixer model.
buildArchitecturesConstruct an untrained CorNET regressor with one linear output.
buildArchitecturesBuild a EfficientNetV2 model.
buildArchitecturesConstruct an untrained one-frame FastEnhancer with named streaming inputs and outputs.
buildArchitecturesBuild a MetaFormer model.
buildArchitecturesConstruct an untrained MiniResNet-v1 classifier for NHWC spectrogram patches.
buildArchitecturesBuild a faithful MLPerf Tiny architecture without loading or converting weights.
buildArchitecturesBuild a MobileNetV1 model.
buildArchitecturesBuild a MobileOne model.
buildArchitecturesBuild a RegNet model.
buildArchitecturesBuild a ResNet model.
buildArchitecturesBuild the Silero VAD v6 16 kHz streaming model, untrained.
buildArchitecturesBuild the model a spec describes.
buildArchitecturesBuild a TCN model.
buildArchitecturesConstruct an untrained TimePPG regressor with one linear output.
buildArchitecturesBuild a TsMixer model.
buildArchitecturesBuild a UNet model.
buildArchitecturesBuild a UNext model.
CalibrationRecordConversionThe calibration array as stored (``.npy``), its length and, for a streaming model, the state resets.
CascadedBiquadFilterPreprocessingImplements a 2nd order cascaded biquad filter using direct form 1 structure.
check_calibrationConversionReject missing, unexpected or malformed calibration data.
check_named_calibrationConversionReject calibration for a model with several inputs unless it names every input once.
check_resetsConversionRefuse state resets that are not increasing steps from 1 to ``steps - 1`` of a streaming model.
compact_tcn_paramsArchitecturesFour small SE4 blocks with 1/2/4/8 dilations and per-point linear output.
composer_layerArchitecturesComposes a sequential set of networks/layers.
ComposerLayerParamsArchitecturesComposer layer parameters
ComposerParamsArchitecturesComposer Network parameters
compute_checksumUtilitiesCompute checksum of file.
compute_metricsMetricsCompute set of metrics for y_true and y_pred.
conformer_blockArchitecturesConformer block
conformer_layerArchitecturesConformer functional layer
ConformerBlockParamsArchitecturesConformer block parameters
ConformerParamsArchitecturesConformer parameters
confusion_matrixMetricsCompute confusion matrix using keras w/ addition to normalize.
confusion_matrix_plotPlottingGenerate confusion matrix plot via matplotlib/seaborn
ConfusionMatrixMetricsAccumulate class counts and return a row-normalized confusion matrix.
ContrastiveTrainerTrainingCreates a self-supervised contrastive trainer for a model.
conv_blockArchitecturesConvolutional block
conv_mixer_blockArchitecturesConvMixer block
conv_mixer_layerArchitecturesConvMixer: https://openreview.net/pdf?id=TVHS5Y4dNvM.
conv_token_mixerArchitecturesToken mixer using separable convolution
conv1dLayers1D convolutional layer using 2D convolutional layer
conv2dLayers2D convolutional layer
ConversionModeConversionHow the Keras model is traced for conversion.
convert_inputs_to_tf_datasetDataConvert inputs to tf.data.Dataset.
convert_litertConversionConvert a Keras model to LiteRT bytes; ``export_model`` validates the arguments first.
ConvMixerParamsArchitecturesConvMixer parameters
CorNetParamsArchitecturesCorNET heart-rate regressor: two convolution stages then stacked LSTMs.
create_dataset_from_dataDataHelper function to create dataset from static data
create_interleaved_dataset_from_generatorDataAdapt caller-owned schedules to tf.data without changing sample weights.
DataSourceDataRecords addressed by index, such as a list or a Grain source.
disable_tensorflow_gpuUtilitiesDisable TensorFlow GPU
DistillerTrainingTrain a student using target labels and a teacher's softened predictions.
download_fileUtilitiesDownload file from supplied url to destination streaming.
download_s3_fileUtilitiesDownload a file from S3
download_s3_objectUtilitiesDownload an object from S3
download_s3_objectsUtilitiesDownload all objects in a S3 bucket with a given prefix.
download_s3_prefixUtilitiesDownload all objects under an S3 prefix into a local directory.
efficientnet_coreArchitecturesEfficientNet core
EfficientNetParamsArchitecturesEfficientNet parameters
efficientnetv2_layerArchitecturesCreate EfficientNet V2 TF functional model
EmaResidualVectorQuantizerLayersResidual VQ with EMA codebook updates.
env_flagUtilitiesReturn the specified environment variable coerced to a bool, as follows:
environment_differencesConversionHow ``current`` differs from ``recorded``, in the versions that can change exported bytes.
environment_recordConversionDescribe the running environment.
EnvironmentEntryConversionVersions that can change exported bytes.
EnvironmentRecordConversion`dataclass`
exportConversionExport a Keras model to LiteRT with its export record (``helia-edge/export-record@1``).
ExportConversion`dataclass`
export_createPackageBuild SPEC, load its weights, export it and write model.tflite, model.weights.h5 and record.json.
export_litertConversionExport with an already validated spec and calibration array.
export_modelConversionExport a Keras model.
export_reproducePackageExport a record's model again and compare.
export_schemaPackagePrint the JSON Schema of the export record (helia-edge/export-record@1).
ExportOptionsConversionFormat options of a LiteRT export.
ExportRecordConversionOne exported artifact: the model, its weights, how it was exported, and the result.
ExportResultConversion`dataclass`
ExportSettingsConversionHow the artifact was exported. ``batch_size`` is the batch of every model input.
ExportSpecConversionWhat to export. ``precision``, ``io_dtype`` and ``mode`` have no defaults.
family_mappingConversionThe weight mapping ``name`` of the spec's family (its params module's ``MAPPINGS``).
fastenhancer_mappingArchitecturesMapping of every weight of ``build(params)`` from folded tensors in ONNX export layout.
fastenhancer_weight_shapesArchitecturesFolded tensors in ONNX/PyTorch layout, keyed by module path.
FastEnhancerCompressionArchitecturesDrop the Nyquist bin and compress magnitude: x * max(|x|, 1e-5)^(c - 1).
FastEnhancerFrequencyAttentionArchitecturesMulti-head self-attention across frequency bands, no output projection.
FastEnhancerFrequencyProjectionArchitecturesProject the frequency axis of (batch, freq, channels) with a [in, out] kernel.
FastEnhancerGRUStepArchitecturesOne GRU step per frequency band, gates z, r, h and reset after matmul.
FastEnhancerMaskOutputArchitecturesApply a complex mask, undo compression and restore a zero Nyquist bin.
FastEnhancerParamsArchitecturesFolded-inference FastEnhancer config for one spectral frame per call.
FastEnhancerPositionalEmbeddingArchitecturesAdd a learned (freq, channels) embedding.
FastEnhancerResolvedConfigArchitecturesSerializable record of a preset, its overrides and the concrete config.
FastEnhancerRNNFormerParamsArchitecturesRNNFormer stage: per-band GRU over time, then attention across bands.
fc_blockArchitecturesFully connected block
file_recordConversionThe record of ``data`` written as ``name``.
file_sha256Conversionsha256 of a file's bytes.
FileRecordConversionA file written next to the record, by name, sha256 and size.
FirFilterPreprocessingApply FIR filter to the input.
FrequencyMixStyle2DAugmentationApply frequency mix style augmentation to the 2D input.
GateReorderPackageReorder equal gate blocks along ``axis``, for example ONNX LSTM ``"iofc"`` to Keras ``"ifco"``.
geluLayersGeLU activation layer
generate_bottleneck_blockArchitecturesGenerate functional bottleneck block.
generate_residual_blockArchitecturesGenerate functional residual block
get_butter_sosPreprocessing`cached`
get_flopsMetricsCalculate FLOPS for keras.Model or keras.Sequential.
get_output_signatureDataGet output signature from sample outputs
get_output_signature_from_fnDataGet output signature from a function
get_output_signature_from_genDataGet output signature from a generator
get_predicted_threshold_indicesMetricsGet prediction indices that are above threshold (confidence level).
gluLayersGated linear unit layer
golden_npzConversionA golden@2 sequence for a streaming model: ``frames`` are consecutive calls of its signal input.
GoldenRecordConversionA ``helia-model-zoo/golden@2`` sequence: ``steps`` calls with the state carried and reset at
gradient_stepTrainingDifferentiate ``loss_fn`` with the active backend and apply ``model.optimizer`` once.
GSAutoencoderTrainingConvenience wrapper around (encoder -> GumbelSoftmaxBottleneck -> decoder).
GumbelSoftmaxBottleneckLayersDiscrete bottleneck via Gumbel-Softmax (Concrete) with optional straight-through hard one-hot.
hard_sigmoidLayersHard sigmoid activation layer
helia_exportUtilitiesRegister serializable symbols; path is retained for API compatibility.
HeliaEdgeRecordConversionThe helia-edge that exported: its version, how the version identifies the code, and the commit
import_weightsPackageSet every weight of ``model`` from the file at ``path`` as ``mapping`` describes.
imported_sourceConversionThe record of weights imported through ``mapping`` from a file with ``sha256``.
ImportReportPackage`dataclass`
infoPackagePrint versions, the KERAS_BACKEND variable and installed optional capabilities.
inspect_modelPackagePrint a .tflite model's inputs, outputs and operators as JSON.
interval_maskAugmentationSample one interval per example; returned mask broadcasts over channels.
IODTypeConversionElement type of an exported model's inputs and outputs.
IORecordConversionThe artifact's inputs and outputs in subgraph order, read back from the artifact.
l2_normalizeLossesPerforms L2 normalization on a tensor along a given axis.
layer_normalizationLayersLayer normalization
LayerNormalizationLayersKeras ``LayerNormalization`` that also normalizes non-trailing axes on the Torch backend.
LayerNormalization1DPreprocessingApply Layer Normalization to the input.
LayerNormalization2DPreprocessingApply Layer Normalization to the input.
linear_filterbanksArchitecturesReturn fixed triangular (pre, post) frequency projections as [in, out] kernels.
litert_unavailableConversionWhy this process cannot export LiteRT, one line each; empty when it can.
LiteRTRunnerConversionRun a single-input, single-output ``.tflite`` model one sample at a time.
LiteRTStreamRunnerConversionRun a streaming ``.tflite`` model one step at a time, carrying its state as raw tensors.
load_export_recordConversionRebuild the Keras model an export record describes, with its weights.
load_modelArchitecturesLoads a Keras model stored either remotely or locally.
load_npyConversionA ``.npy`` array, memory-mapped, so that a header claiming more data than the file holds is refused
load_pklUtilitiesLoad pickled file.
load_specConversionA ``ModelSpec`` from a YAML (``.yaml``/``.yml``) or JSON file.
load_weightsConversionLoad a Keras weights file (``.weights.h5`` or ``.keras``) into ``model``.
mainPackageEntry point of the ``helia-edge`` command.
make_divisibleArchitecturesEnsure layer has # channels divisble by divisor
MaskedAutoencoderTrainingMasked reconstruction with Keras fit() and independently callable objectives.
MaskedPatchEncoder2DLayersProject patches with position embeddings and sample masks from a seeded stream.
matches_specUtilitiesTest whether data object matches the desired spec.
max_projectionLayersMagnitude of complex values as the largest of 9 projections of (|re|, |im|), within 0.25% in float32.
maybe_register_serializableUtilitiesRegister a function or configurable object with Keras serialization.
mbconv_blockLayersMBConv block w/ expansion and SE
MBConvParamsLayersMBConv parameters
metaformer_blockArchitecturesMetaformer block
metaformer_layerArchitecturesMetaFormer functional layer
MetaFormerBlockParamsArchitecturesMetaFormer block parameters
MetaFormerParamsArchitecturesMetaFormer parameters
MiniResNetV1ParamsArchitecturesValidated architecture config, independent of inputs and weight assets.
mishLayersMish activation layer
mlp_channel_mixerArchitecturesChannel mixer using MLP via 1x1 convolutions
MlperfTinyParamsArchitecturesSelect a faithful fixed architecture; initialization and export belong to callers.
mobilenetv1_layerArchitecturesModified MobileNetV1
MobileNetV1ParamsArchitecturesMobileNetV1 parameters
mobileone_blockArchitecturesMBConv block w/ expansion and SE
mobileone_layerArchitecturesCreate MobileOne TF functional model
MobileOneBlockParamsArchitecturesMobileOne block parameters
MobileOneParamsArchitecturesMobileOne parameters
ModePackageHow ``helia-edge export create`` traces the model.
ModelSpecArchitecturesThe serializable identity of an architecture.
MultiF1ScoreMetricsA wrapper around keras.metrics.F1Score to handle multi-dimensional data.
multilabel_confusion_matrix_plotPlottingGenerate multilabel confusion matrix plot via matplotlib/seaborn
NameArgsArchitecturesName and arguments
no_gradTrainingDisable gradient tracking on Torch; a no-op on other backends.
norm_layerArchitecturesNormalization layer
norm_layerArchitecturesNormalization layer
normalizationLayersCreates normalization layer based on type
normalizationArchitecturesNormalization layer
Normalization1DPreprocessingApply fixed mean/variance normalization to 1D inputs.
Normalization2DPreprocessingApply fixed mean/variance normalization to 2D inputs.
NotSupportedTrainingThe active Keras backend is not supported by this trainer.
operator_namesConversionBuiltin operator names of every subgraph's operators, in execution order.
parse_factorUtilitiesNormalize scalar or paired bounds and validate their range.
patch_embeddingArchitecturesPatch embedding layer using 2D convolution
PatchLayer2DLayersExtract flattened patches from images shaped (batch, height, width, ch).
plot_history_metricsPlottingPlot training history metrics returned by model.fit.
pool_token_mixerArchitecturesToken mixer using average pooling
PRDMetricsPercent RMS difference metric with optional energy normalization.
PrecisionConversionNumeric format of an exported graph.
px_plot_confusion_matrixPlottingGenerate confusion matrix plot via plotly
random_id_generatorUtilitiesSample with replacement, using optional nonnegative relative weights.
RandomAugmentation1DPipelineAugmentationApply repeated random layer choices to an entire batch.
RandomAugmentation2DPipelineAugmentationThe same batchwise composition contract for image transforms.
RandomBackgroundNoises1DAugmentationApply random background noises to the input.
RandomChannelAugmentationRandomly picks a single channel from the input samples.
RandomChoiceAugmentationChoose one layer for a whole batch; branches must have compatible outputs.
RandomCrop1DAugmentationTraining-only crop; inference leaves the original duration unchanged.
RandomCrop2DAugmentationTraining-only image crop; inference leaves the original extent unchanged.
RandomCutout1DAugmentationReplace random temporal intervals in each example during training.
RandomCutout2DAugmentationReplace random rectangular regions in each example during training.
RandomFlip2DAugmentationTraining-only horizontal (width) and vertical (height) image flips.
RandomGaussianNoise1DAugmentationApply additive zero-centered Gaussian noise.
RandomNoiseDistortion1DAugmentationApply random noise distortion to the 1D input.
RandomSineWaveAugmentationAdds a sine wave to the input.
readPackageThe tensors of the file at ``path``, read as ``format``.
read_onnxPackageThe initializers of a self-contained ``.onnx`` model, by name.
read_safetensorsPackageThe tensors of a ``.safetensors`` file, by name (little-endian; BF16 is not supported).
read_torchPackageThe tensors of a PyTorch state dict saved with ``torch.save``, loaded with ``weights_only=True``.
ReconstructionTrainingMasked target patches and their corresponding predicted patches.
ReconstructionLossTrainingReconstruction objective together with the patches used to compute it.
register_keras_serializablesPackageRegister custom objects supported by the selected Keras backend.
regnet_coreArchitecturesRegNet core
regnet_layerArchitecturesCreate RegNet TF functional model
RegNetBlockParamArchitecturesRegNet block parameters
RegNetParamsArchitecturesRegNet parameters
reluLayersReLU activation layer w/ optional truncation to ReLU6
relu6LayersHard ReLU activation layer
reproduceConversionRebuild the model a record describes, export it again with the same settings and compare.
ReproductionConversion`dataclass`
require_backendTrainingReturn the active backend, or raise ``NotSupported`` naming ``feature`` and ``supported``.
Rescaling1DPreprocessingRescale the input samples.
Rescaling2DPreprocessingRescale the input samples.
ReshapePackageReshape in C order, as ``numpy.reshape``.
ResidualVectorQuantizerLayersResidual Vector Quantizer (RVQ) with straight-through estimator.
Resizing1DPreprocessingResize signals with bicubic interpolation during training and inference.
Resizing2DPreprocessingResize images and aligned data during training and inference.
resnet_layerArchitecturesGenerate functional ResNet model.
ResNetBlockParamsArchitecturesResNet block parameters
ResNetParamsArchitecturesResNet parameters
resolve_fastenhancerArchitecturesResolve an official preset with validated overrides into a full record.
resolve_template_pathUtilitiesResolve templated path w/ supplied substitutions.
roc_auc_plotPlottingGenerate ROC plot via matplotlib/seaborn
SamplePreprocessing`dataclass`
save_pklUtilitiesSave python objects into pickle file.
se_blockArchitecturesSqueeze and excite block
se_layerLayersSqueeze & excite functional layer
set_random_seedUtilitiesSet Python, NumPy and selected Keras backend seeds; return the seed.
setup_loggerUtilitiesSetup logger with Rich
sigmoidLayersSigmoid activation layer
silence_tensorflowUtilitiesSilence every unnecessary warning from tensorflow.
SileroBlockStftArchitecturesSTFT magnitude of one call (576 samples) from convolutions over 64-sample blocks.
SileroFrameConvArchitecturesAn encoder ``Conv1D`` with ReLU over frames held as rows of a (frames, 1, channels) image.
SileroLiveTapsArchitecturesA zero-padded encoder convolution as a dense layer over the kernel taps that see real frames.
SileroVadParamsArchitecturesSilero VAD v6 (16 kHz). The geometry is fixed by the v6.2.2 weights; the options choose how the
SimCLRLossLossesImplements SimCLR Cosine Similarity loss.
SimCLRTrainerTrainingCreates a SimCLRTrainer.
SnrMetricsSignal-to-Noise Ratio (SNR) metric where
SourceConversionA file named by content: its sha256 and, optionally, where to fetch it (never a local path).
SourceFormatPackageFile formats ``import_weights`` reads (see ``helia_edge.importers.readers``).
SourcePinPackageThe one source file a mapping was written for.
SpecAugment2DAugmentationMask frequency (height) and time (width), independently per example.
SplitPackageTake part ``index`` of ``parts`` equal parts along ``axis``.
state_inputLayersModel input ``state_in_k`` for state pair ``k``.
state_input_nameConversionName of the input of state pair ``k``.
state_outputLayersName ``x`` as the model output ``state_out_k`` of state pair ``k``.
state_output_nameConversionName of the output of state pair ``k``.
state_pairConversion``("in", k)`` or ``("out", k)`` for a state tensor name, otherwise None.
state_scales_tiedConversionWhether every integer state pair has one scale and zero point.
StftMagnitudeLayersMagnitude of a short-time Fourier transform computed as a strided convolution with a stored basis.
stream_calibrationConversionCalibration for a streaming model: its signal inputs with the states the model produces from them.
StreamingLSTMCellLayersOne LSTM step: ``[x, h, c] -> [h', c']``.
StreamModeUtilitiesSelect how sample identifiers are scheduled across generator partitions.
SubsampleBlockParamsArchitecturesSubsample block parameters
subsamplerArchitecturesSubsampler block
SumPartsPackageAdd ``parts`` equal parts along ``axis``, for example an ONNX LSTM's input and recurrent biases.
suppress_os_stdioUtilitiesRedirects the OS stdout (fd=1) and stderr (fd=2) to /dev/null, then restores them on exit.
swishLayersSwish activation layer w/ optional hard variant
tcn_block_lgArchitecturesTCN large block
tcn_block_mbArchitecturesTCN mbconv block
tcn_block_smArchitecturesTCN small block
tcn_coreArchitecturesTCN core
tcn_layerArchitecturesTCN functional layer
TcnBlockParamsArchitecturesTCN block parameters
TcnParamsArchitecturesTCN parameters
tensor_recordsConversionRead the main subgraph's input and output tensors from a ``.tflite`` flatbuffer.
TensorEntryConversionA model input or output; dynamic dimensions are -1. A state tensor has the index ``pair`` of its
TensorPayloadPreprocessingTwo-level tensor-only schema accepted by portable preprocessing layers.
TensorRecordConversion`dataclass`
TensorRoleConversionRole of a model input or output.
threshold_predictionsMetricsGet prediction indices that are above threshold (confidence level).
tie_state_scalesConversionGive both tensors of each integer state pair one scale and zero point.
TimePPGParamsArchitecturesTEMPONet-derived PPG heart-rate regressor (Burrello et al., 2022).
to_grainDataRead ``source`` through Grain: shuffle, repeat, transform, batch and prefetch.
to_native_fp16ConversionReturn a graph whose inputs, weights, activations and outputs are FLOAT16.
to_tf_datasetDataWrap a re-iterable of NumPy batches, such as a Grain dataset, as a ``tf.data.Dataset``.
to_torch_loaderDataWrap a re-iterable of NumPy batches, such as a Grain dataset, as a Torch ``DataLoader``.
TQDMProgressBarCallbacksTQDM Progress Bar callback.
TransposePackagePermute the axes, as ``numpy.transpose``.
TruePRDMetricsCompatibility wrapper for normalized PRD.
ts_blockArchitecturesResidual block of TSMixer.
tsmixer_layerArchitecturesTsMixer layer
TsMixerBlockParamsArchitecturesTsMixer block parameters
TsMixerParamsArchitecturesTsMixer parameters
undot_layer_namesArchitecturesRename layers whose names contain ``.`` in a saved Keras model config.
unet_layerArchitecturesCreate UNet TF functional model
UNetBlockParamsArchitecturesUNet block parameters
UNetParamsArchitecturesUNet parameters
unext_blockArchitecturesCreate UNext block
unext_coreArchitecturesCreate UNext TF functional core
unext_layerArchitecturesCreate UNext TF functional model
UNextBlockParamsArchitecturesUNext block parameters
UNextParamsArchitecturesUNext parameters
unidentified_installConversionWhy ``record`` does not identify the helia-edge code, and how to install code that does.
uniform_id_generatorUtilitiesYield each ID once per cycle; shuffle mutates the supplied sequence.
use_helia_layer_normalizationArchitecturesSwap Keras ``LayerNormalization`` entries for ``helia_edge.layers.LayerNormalization``.
VectorQuantizerLayersVector-quantization bottleneck (VQ-VAE style) with straight-through estimator.
VQAutoencoderTrainingConvenience wrapper around (encoder -> VectorQuantizer -> decoder).
WeightImportConversionWeights imported from another framework through ``mapping`` (a name in the family's ``MAPPINGS``).
WeightMappingPackageEvery weight of one architecture, from one source format.
WeightRowPackageOne model weight: its source tensors, how they combine, and the transforms to its layout.
weights_digestConversion``sha256:`` over the model's weights in ``model.weights`` order, independent of the file they came from.
WeightsRecordConversionThe weights, by ``weights_digest``, and their import when they came from another framework.
yblockArchitecturesRegNet Y-Block
zblockArchitecturesRegNet X-Block