layers

package
v1.27.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package layers provides neural network layer implementations for the Zerfoo ML framework. It is organized into sub-packages by functional category, with a central registry that wires every layer into the model builder. (Stability: stable)

Sub-packages by category

Activations:

Attention:

Core math and tensor operations:

Embeddings:

Normalization:

Regularization:

Transformer:

State space models:

Recurrent:

Higher-order / composite:

Registry:

Layer registry

The registry sub-package calls [model.RegisterLayer] for every built-in layer, associating a string name (e.g. "MatMul", "Softmax") with a generic builder function. Call [registry.RegisterAll] once at startup to make all layers available to the model builder.

Adding a new layer

To add a new layer:

  1. Create the layer in the appropriate sub-package (or a new sub-package if no existing category fits). Implement the builder function with the signature expected by [model.RegisterLayer].
  2. Register the layer in [registry.RegisterAll] by adding a [model.RegisterLayer] call with a unique name and the builder function.
  3. Write tests in the same sub-package.

Stability: stable

Directories

Path Synopsis
Package activations provides activation function layers.
Package activations provides activation function layers.
Package attention provides attention mechanisms for neural networks.
Package attention provides attention mechanisms for neural networks.
Package audio provides audio-related neural network layers.
Package audio provides audio-related neural network layers.
Package components provides reusable components for neural network layers.
Package components provides reusable components for neural network layers.
Package core provides core neural network layer implementations.
Package core provides core neural network layer implementations.
Package embeddings provides neural network embedding layers.
Package embeddings provides neural network embedding layers.
Package gather provides the Gather layer for embedding-table lookup.
Package gather provides the Gather layer for embedding-table lookup.
Package hrm implements the Hierarchical Reasoning Model.
Package hrm implements the Hierarchical Reasoning Model.
Package normalization provides normalization layers for neural networks.
Package normalization provides normalization layers for neural networks.
Package recurrent provides recurrent neural network layers.
Package recurrent provides recurrent neural network layers.
Package reducesum provides the ReduceSum layer for axis-wise reduction.
Package reducesum provides the ReduceSum layer for axis-wise reduction.
Package registry provides a central registration point for all layer builders.
Package registry provides a central registration point for all layer builders.
Package regularization provides regularization layers for neural networks.
Package regularization provides regularization layers for neural networks.
Package residual provides residual connection layers for neural networks.
Package residual provides residual connection layers for neural networks.
Package ssm implements state space model layers.
Package ssm implements state space model layers.
Package timeseries provides time-series specific neural network layers.
Package timeseries provides time-series specific neural network layers.
Package transformer provides transformer building blocks such as the Transformer `Block` used in encoder/decoder stacks.
Package transformer provides transformer building blocks such as the Transformer `Block` used in encoder/decoder stacks.
Package transpose provides the Transpose layer for axis permutation.
Package transpose provides the Transpose layer for axis permutation.
Package vision provides vision-related neural network layers.
Package vision provides vision-related neural network layers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL