layers

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 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.

Sub-packages by category

Activations:

Attention:

Core math and tensor operations:

Embeddings:

Normalization:

Regularization:

Transformer:

Sequence modeling:

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.

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 for the Zerfoo ML framework.
Package embeddings provides neural network embedding layers for the Zerfoo ML framework.
Package gather provides the Gather layer for the Zerfoo ML framework.
Package gather provides the Gather layer for the Zerfoo ML framework.
Package hrm implements the Hierarchical Reasoning Model.
Package hrm implements the Hierarchical Reasoning Model.
Package normalization provides various normalization layers for neural networks.
Package normalization provides various normalization layers for neural networks.
Package reducesum provides the ReduceSum layer for the Zerfoo ML framework.
Package reducesum provides the ReduceSum layer for the Zerfoo ML framework.
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 sequence provides sequence modeling layers such as State Space Models.
Package sequence provides sequence modeling layers such as State Space Models.
Package ssm implements state space model layers.
Package ssm implements state space model 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 the Zerfoo ML framework.
Package transpose provides the Transpose layer for the Zerfoo ML framework.
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