Documentation
¶
Overview ¶
Package zerfoo provides the core building blocks for creating and training neural networks. It offers a prelude of commonly used types to simplify development and enhance readability of model construction code.
Index ¶
- func BuildFromZMF[T tensor.Numeric](engine compute.Engine[T], ops numeric.Arithmetic[T], m *zmf.Model) (*graph.Graph[T], error)
- func NewAdamW[T tensor.Numeric](learningRate, beta1, beta2, epsilon, weightDecay T) *optimizer.AdamW[T]
- func NewCPUEngine[T tensor.Numeric]() compute.Engine[T]
- func NewDefaultTrainer[T tensor.Numeric](graph *graph.Graph[T], loss graph.Node[T], opt optimizer.Optimizer[T], ...) *training.DefaultTrainer[T]
- func NewFloat32Ops() numeric.Arithmetic[float32]
- func NewGraph[T tensor.Numeric](engine compute.Engine[T]) *graph.Builder[T]
- func NewMSE[T tensor.Numeric](engine compute.Engine[T]) *loss.MSE[T]
- func NewRMSNorm[T tensor.Numeric](name string, engine compute.Engine[T], ops numeric.Arithmetic[T], modelDim int, ...) (*normalization.RMSNorm[T], error)
- func NewTensor[T tensor.Numeric](shape []int, data []T) (*tensor.TensorNumeric[T], error)
- func RegisterLayer[T tensor.Numeric](opType string, builder model.LayerBuilder[T])
- func UnregisterLayer(opType string)
- type Batch
- type Engine
- type Graph
- type LayerBuilder
- type Node
- type Numeric
- type Parameter
- type Tensor
- type ZMFModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildFromZMF ¶
func BuildFromZMF[T tensor.Numeric]( engine compute.Engine[T], ops numeric.Arithmetic[T], m *zmf.Model, ) (*graph.Graph[T], error)
BuildFromZMF builds a graph from a ZMF model.
func NewAdamW ¶
func NewAdamW[T tensor.Numeric](learningRate, beta1, beta2, epsilon, weightDecay T) *optimizer.AdamW[T]
NewAdamW creates a new AdamW optimizer.
func NewCPUEngine ¶
NewCPUEngine creates a new CPU engine for the given numeric type.
func NewDefaultTrainer ¶
func NewDefaultTrainer[T tensor.Numeric]( graph *graph.Graph[T], loss graph.Node[T], opt optimizer.Optimizer[T], strategy training.GradientStrategy[T], ) *training.DefaultTrainer[T]
NewDefaultTrainer creates a new default trainer.
func NewFloat32Ops ¶
func NewFloat32Ops() numeric.Arithmetic[float32]
NewFloat32Ops returns the float32 arithmetic operations.
func NewRMSNorm ¶
func NewRMSNorm[T tensor.Numeric](name string, engine compute.Engine[T], ops numeric.Arithmetic[T], modelDim int, options ...normalization.RMSNormOption[T]) (*normalization.RMSNorm[T], error)
NewRMSNorm is a factory function for creating RMSNorm layers.
func RegisterLayer ¶
func RegisterLayer[T tensor.Numeric](opType string, builder model.LayerBuilder[T])
RegisterLayer registers a new layer builder.
func UnregisterLayer ¶
func UnregisterLayer(opType string)
UnregisterLayer unregisters a layer builder.
Types ¶
type Batch ¶
type Batch[T tensor.Numeric] struct { Inputs map[graph.Node[T]]*tensor.TensorNumeric[T] Targets *tensor.TensorNumeric[T] }
Batch represents a training batch.
type LayerBuilder ¶
type LayerBuilder[T tensor.Numeric] func( engine compute.Engine[T], ops numeric.Arithmetic[T], name string, params map[string]*graph.Parameter[T], attributes map[string]interface{}, ) (graph.Node[T], error)
LayerBuilder is a function that builds a layer.
Directories
¶
Path | Synopsis |
---|---|
Package compute implements tensor computation engines and operations.
|
Package compute implements tensor computation engines and operations. |
Package device provides device abstraction and memory allocation interfaces.
|
Package device provides device abstraction and memory allocation interfaces. |
Package distributed provides distributed training strategies and coordination mechanisms for multi-node machine learning workloads in the Zerfoo framework.
|
Package distributed provides distributed training strategies and coordination mechanisms for multi-node machine learning workloads in the Zerfoo framework. |
coordinator
Package coordinator provides a distributed training coordinator.
|
Package coordinator provides a distributed training coordinator. |
Package graph provides a computational graph abstraction.
|
Package graph provides a computational graph abstraction. |
internal
|
|
layers
|
|
activations
Package activations provides activation function layers.
|
Package activations provides activation function layers. |
attention
Package attention provides attention mechanisms for neural networks.
|
Package attention provides attention mechanisms for neural networks. |
components
Package components provides reusable components for neural network layers.
|
Package components provides reusable components for neural network layers. |
core
Package core provides core neural network layer implementations.
|
Package core provides core neural network layer implementations. |
embeddings
Package embeddings provides neural network embedding layers for the Zerfoo ML framework.
|
Package embeddings provides neural network embedding layers for the Zerfoo ML framework. |
gather
Package gather provides the Gather layer for the Zerfoo ML framework.
|
Package gather provides the Gather layer for the Zerfoo ML framework. |
hrm
Package hrm implements the Hierarchical Reasoning Model.
|
Package hrm implements the Hierarchical Reasoning Model. |
normalization
Package normalization provides various normalization layers for neural networks.
|
Package normalization provides various normalization layers for neural networks. |
reducesum
Package reducesum provides the ReduceSum layer for the Zerfoo ML framework.
|
Package reducesum provides the ReduceSum layer for the Zerfoo ML framework. |
registry
Package registry provides a central registration point for all layer builders.
|
Package registry provides a central registration point for all layer builders. |
transformer
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. |
transpose
Package transpose provides the Transpose layer for the Zerfoo ML framework.
|
Package transpose provides the Transpose layer for the Zerfoo ML framework. |
Package model provides the core structures and loading mechanisms for Zerfoo models.
|
Package model provides the core structures and loading mechanisms for Zerfoo models. |
hrm
Package hrm provides experimental Hierarchical Reasoning Model types.
|
Package hrm provides experimental Hierarchical Reasoning Model types. |
Package numeric provides precision types, arithmetic operations, and generic constraints for the Zerfoo ML framework.
|
Package numeric provides precision types, arithmetic operations, and generic constraints for the Zerfoo ML framework. |
pkg
|
|
tokenizer
Package tokenizer provides basic text tokenization functionality.
|
Package tokenizer provides basic text tokenization functionality. |
Package tensor provides a multi-dimensional array (tensor) implementation.
|
Package tensor provides a multi-dimensional array (tensor) implementation. |
testing
|
|
testutils
Package testutils provides testing utilities and mock implementations for the Zerfoo ML framework.
|
Package testutils provides testing utilities and mock implementations for the Zerfoo ML framework. |
Package training provides tools for training neural networks.
|
Package training provides tools for training neural networks. |
loss
Package loss provides various loss functions for neural networks.
|
Package loss provides various loss functions for neural networks. |
optimizer
Package optimizer provides various optimization algorithms for neural networks.
|
Package optimizer provides various optimization algorithms for neural networks. |
Package types contains shared, fundamental types for the Zerfoo framework.
|
Package types contains shared, fundamental types for the Zerfoo framework. |