gomlx

module
v0.28.10 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0

README ยถ

GoMLX, an Accelerated ML and Math Framework

Documentation GoDev DockerHub Apache 2.0 License Slack Mentioned in Awesome Go Sponsor GoMLX
Linux/amd64 Tests Linux/arm64 Tests Darwin/arm64 Tests Windows/amd64 Tests Coverage

๐Ÿ“– About GoMLX - gomlx.github.io

GoMLX Gopher

GoMLX is an easy-to-use set of Machine Learning and generic math libraries and tools. It can be seen as a PyTorch/Jax/TensorFlow for Go.

It can be used to train, fine-tune, modify, and combine machine learning models (it reads models from HuggingFace, with a growing list of model support). It provides all the tools to make that work easy: from a complete set of differentiable operators, all the way to UI tools to plot metrics while training in a notebook.

It defines a common "backend" API to run models. It includes a pure Go backend that is portable and also runs in WASM (in a browser), see demo created with GoMLX.

The "xla" backend is an optimized engine based on OpenXLA that uses just-in-time compilation to CPU, GPUs (Nvidia, and likely AMD ROCm, Intel, Macs) and Google's TPUs. It also supports modern distributed execution (new, still being actively improved) for multi-TPU or multi-GPU using XLA Shardy, an evolution of the GSPMD distribution). It's the same engine that powers Google's Jax, TensorFlow and Pytorch/XLA, and it has the same speed in many cases (*).

More recently, it added the "onnx" backend, which uses ONNX Runtime to run GoMLX computations. It can also save models to .onnx file format.

[!Tip]

It was developed to be a full-featured ML platform for Go, productionizable and easy to experiment with ML ideas โ€”see Long-Term Goals below.

It strives to be simple to read and reason about, leading the user to a correct and transparent mental model of what is going on (no surprises)โ€”aligned with Go philosophy. At the cost of more typing (more verbose) at times.

It is also incredibly flexible and easy to extend and try non-conventional ideas: use it to experiment with new optimizer ideas, complex regularizers, funky multitasking, etc.

Documentation is kept up to date (if it is not well-documented, it is as if the code is not there), and error messages are useful (always with a stack-trace) and try to make it easy to solve issues.

๐Ÿ—บ๏ธ Overview

GoMLX is a full-featured ML framework, supporting various well-known ML components
from the bottom to the top of the stack. But it is still only a slice of what a major ML library/framework should provide (like TensorFlow, Jax, or PyTorch).

GoMLX Examples

Training examples:

Inference Examples:

Backends

GoMLX is a friendly "intermediary ML API", that hosts a common API and a library of ML layers and such. But per-se it doesn't execute any computation: it relies on different backends to compile and execute the computation on very different hardware.

The supporting backend package must always be included in a GoMLX program, and the default backends (xla, go and optionally onnx, see below) are included if you import:

import _ "github.com/gomlx/gomlx/backends/default"

At runtime, it will pick the fastest backend available to you, but you can specify which backend to use by setting the GOMLX_BACKEND environment variable (e.g. export GOMLX_BACKEND=xla:cuda, export GOMLX_BACKEND=xla:cpu, or export GOMLX_BACKEND=go).

There is a common compute.Backend interface defined in github.com/gomlx/compute. And there are 3 different implementations (more planned in the future):

  1. xla: OpenXLA backend for CPUs, GPUs, and TPUs. State-of-the-art as these things go, but only static-shape. For linux/amd64, linux/arm64 (CPU) and darwin/arm64 (CPU) for now. The Go API is defined under the go-xla project, in github.com/gomlx/go-xla/compute/xla/autoinstall. It is included by default.
  2. go: a pure Go backend (no C/C++ dependencies), implemented in github.com/gomlx/compute/gobackend, but included by default. It is slower than XLA but very portable (compiles to WASM/Windows/etc.).
  3. ๐Ÿš€ NEW ๐Ÿš€ onnx: A backend that uses ONNX Runtime to execute GoMLX graphs: for Linux/Windows AMD64. Build with tag --tags=onnx to get it imported by github.com/gomlx/gomlx/backends/default, or import it directly from github.com/gomlx/compute-onnx.
Highlights

Some selected highlights:

  • ๐Ÿš€ NEW ๐Ÿš€: Gradient checkpointing: trade-off memory usage for recomputation when training large models, with a very simple API.

  • ๐Ÿš€ NEW ๐Ÿš€: Save models to a .onnx file, that can be used with ONNX Runtime. See example in UCI-Adult demo.

  • HuggingFace Go compatibility with go-huggingface:

    • Download files from models/datasets sharing the same cache framework as the python version.
    • Tokenizers for various classes in pure Go, downloaded directly from HuggingFace.
    • Datasets iterators (using Apache's Parquet format), to experiment with standard datasets.
    • Model parameters reading from GGUF or safetensors format.
    • Model conversion to GoMLX (some models at least) with a compatible transformer library. Includes support to sentence embedding (equivalent to sentence_transformer Python library).
  • Convert ONNX models to GoMLX with onnx-gomlx: both as an alternative for onnxruntime (leveraging XLA), but also to further fine-tune models.

  • Docker "gomlx_jupyterlab" with integrated JupyterLab and GoNB (a Go kernel for Jupyter notebooks)

  • Autodiff: automatic differentiationโ€”only gradients for now, no jacobian.

  • Store and Scope: simple variable management for ML models.

  • ML layers library with the most popular machine learning "layers": FFN layers,
    various activation functions, layer and batch normalization, DyT (Dynamic Tanh normalizer, https://arxiv.org/abs/2503.10622), convolutions, pooling, dropout, Multi-Head-Attention (for transformer layers), LSTM, KAN (B-Splines, GR-KAN/KAT networks, Discrete-KAN, PiecewiseLinear KAN), PiecewiseLinear (for calibration and normalization), various regularizations, FFT (reverse/differentiable), learnable rational functions (both for activations and GR-KAN/KAT networks), VNN (Vector Neural Networks) for SO(3)-Equivariant/Invariant layers, etc.

  • Training library, with some pretty-printing:

    • Plots for Jupyter notebook, using GoNB, a Go Kernel.
    • Various debugging tools: collecting values for particular nodes for plotting, simply logging the value of nodes during training, stack-trace of the code where nodes are created.
  • gomlx_checkpoints, the command line tool to inspect checkpoint of train(-ing) models, generate plots with loss and arbitrary evaluation metrics using Vizb (a separate CLI tool -- --plot is the only flag that needs it installed; everything else works without it). See cmd/gomlx_checkpoints/README.md for usage details. It also allows plotting different models together, to compare their evolution, and -loop gives you a live, auto-refreshing view while a model is still training.

  • Various optimizers: SGD, Adam (AdamW and Adamax).

  • Various losses and metrics.

  • Read Numpy arrays into GoMLX tensors -- see package github.com/gomlx/gomlx/core/tensors/numpy.

  • Distributed Execution (experimental) across multiple GPUs or TPUs with little hints from the user. One only needs to configure a distributed dataset, and the trainer picks up from there. See code change in UCI-Adult demo. Experimental, please report any issues and help us improve it.

๐Ÿš€ v0.28.0 Release ๐Ÿš€

GoMLX Gopher

Large API and package re-organization:

  • backends moved to github.com/gomlx/compute repository!
    • Packages backends, dtypes, shapes and distributed moved to github.com/gomlx/compute.
    • The "go" backend is now implemented in github.com/gomlx/compute/gobackend (it's been greatly improved as well).
    • The "xla" backend is now implemented in github.com/gomlx/go-xla/compute/xla (or to include the auto-installation feature, import github.com/gomlx/go-xla/compute/xla/autoinstall).
  • Removed pkg/ prefix from the top-level packages (no need with internal/ special handling).
  • The context.Context variable container was redesigned (and simplified) into model.Store (the container) and model.Scope (a pointer to a Store with the current scope).
  • The train.Dataset (package ml/train) interface was modernized (and simplified) to use Go's standard iterators. Also now with clearer ownership rules.
  • The train.NewTrainer now uses a generic modelFn type, with a friendlier more flexible signature, using generics and the ModelFnCompatible constraint.

New GoMLX Documentation: gomlx.github.io

New features:

  • Dynamic shapes support for GoMLX: alpha/experimental, only for the Go backend (XLA only supports static shapes). But it will allow more efficient and padding-free (sometimes) models with Go. It also opens up better support for ONNXRuntime backend (a goal for after the v0.28 release).
  • Improvements and some SIMD support for the Go backend (now in repo github.com/gomlx/compute/gobackend).
  • Gradient checkpointing.
  • DyT normalizer.
  • New SchedulingBarrier and OptimizationBarrier primitives.
  • Proper KV-Cache implementation.
  • Package transformer improvements, supporting newer models (Gemma4, etc.)
  • Updates to FusedScaledDotProductAttention, including adding support to the corresponding VJP: enabling the flash attention in XLA+CUDA.

[!Tip] See more details in our CHANGELOG, including how to use cmd/convert_v0.28, a tool that facilitates the changes needed to move to the new API.

๐Ÿ‘ฅ Support

๐Ÿ› ๏ธ + โš™๏ธ Installation

For most users, no installation is needed.

For XLA, it will by default auto-install the required XLA PJRT plugins (for CPU, GPU and TPUs; Linux and Macs) in the user's local lib directory ($HOME/.local/lib/go-xla in Linux; $HOME/Library/Application Support/go-xla in Mac; $HOME\AppData\Local\go-xla in Windows). It can be disabled by setting GOMLX_NO_AUTO_INSTALL or programmatically by calling xla.EnableAutoInstall(false)).

If you want to manually pre-install for building production dockers, a specific version, or such custom setups, see github.com/gomlx/go-xla for details, there is a self-explanatory simple installer program.

If you want to use only a pure Go backend, simply do import _ "github.com/gomlx/compute/gobackend" and there is no need to install anything.

๐Ÿณ Pre-built Docker

The easiest to start playing with it, it's just pulling the docker image that includes GoMLX + JupyterLab + GoNB (a Go kernel for Jupyter) and Nvidia's CUDA runtime (for optional support of GPU) pre-installed -- it is ~5Gb to download.

From a directory you want to make visible in Jupyter, do:

For GPU support add the flag --gpus all to the docker run command below.

docker pull janpfeifer/gomlx_jupyterlab:latest
docker run -it --rm -p 8888:8888 -v "${PWD}":/home/jupyter/work janpfeifer/gomlx_jupyterlab:latest

It will display a URL starting with 127.0.0.1:8888 in the terminal (it will include a secret token needed) that you can open in your browser.

You can open and interact with the tutorial from there, it is included in the docker under the directory Projects/gomlx/examples/tutorial.

More details on the docker here.

It runs on Windows as well: Docker Desktop uses WSL2 under the hood.

๐Ÿงญ Documentation & Tutorial

  • gomlx.github.io - Most up-to-date documentation with an easy get started section, along with the more comprehensive details of each aspect.
  • Tutorial notebook - It covers a bit of everything in a nice to use/read Jupyter notebook.

After that, look at the demos in the examples/ directory.

The library itself is well-documented (pls open issues if something is missing), and the code is not too hard to read. Godoc is available in pkg.go.dev.

Finally, feel free to ask questions: time allowing (when not at work), I'm always happy to help: I'm often connected to Slack channel #gomlx; alternatively the groups.google.com/g/gomlx-discuss.

Inference & Productionization

Inference or serving a model is done currently by using the Go code used to create the model along with the checkpoint with the trained weights and hyperparameters used to train the model. In other words, it uses the same tools used for training.

It's straightforward for instance, to create a Docker with a pretrained model and serve it from there. Or include it in your own application.

For a simple example of how to do this and export a model inference as a library, see .../examples/cifar/classifer, and its use in the last cells of the Cifar-10 demo.

In the future we plan to also export models to ONNX or XLA's StableHLO, and one could use tools that serve those directly, without linking GoMLX -- it will save a little executable size.

๐ŸŽฏ Long-term Goals

GoMLX Machine Learning Animation
  1. Building and training models in Go -- as opposed to Python (or some other language) -- with focus on:
    • Being easy(ier) to read and reason about, leading the user to a correct and transparent mental model of what is going on. Even if that means being more verbose when writing.
    • Clean, separable APIs: individual APIs should be self-contained and decoupled where possible.
    • Composability: Any component should be replaceable, so they can be customized and experimented with. That means sometimes more coding (there is not one magic train object that does everything), but it makes it clear what is happening, and to replace parts with custom versions.
    • Up-to-date documentation: if the documentation is not there or if it's badly written, it's as if the code was not there either.
    • Clear and actionable error reporting
  2. To be a productive research and educational platform to experiment with new ML ideas and learn.
    • Support mirrored training on multiple devices and various forms of distributed training (model and/or data parallelism), in particular to support for large language models and similarly large model training.
  3. To be a robust and reliable platform for production. Some subgoals:
    • Support modern accelerator hardware like TPUs and GPUs.
    • Multiple backends beyond XLA, e.g: llamacpp, WebNN (with Wasm), pure Go version, etc.
    • Import pre-trained models from Hugging Face Hub and allow fine-tuning. Already working for many models, including ONNX support in onnx-gomlx.
    • Compile models to binary as in C-libraries and/or WebAssembly, to be linked and consumed (inference) anywhere (any language).

๐Ÿค” FAQ

  • What are the environment variables used by GoMLX?
    • GOMLX_BACKEND: defines the backend engine to use (if using backends.New()). The value is formatted as "<backend_name>[:<backend_config>]", with the config part being optional. Examples:
      • GOMLX_BACKEND=go: Use the Go backend, the pure Go implementation that is very portable but slow.
      • GOMLX_BACKEND="xla": Use XLA for whatever the default plugin is (it uses cuda if available).
      • GOMLX_BACKEND="xla:help": It will print out documentation on all options for the "xla" backend, and return an error.
      • GOMLX_BACKEND="xla:cpu": Use XLA (the faster backend, only runs on Linux now) for CPU
      • GOMLX_BACKEND="xla:cuda": Use XLA for Nvidia CUDA; Or set it to xla:cuda,preallocate=false to prevent it from preallocating 75% of the GPU memory.
      • GOMLX_BACKEND="xla:/path/to/my/pjrt_plugin.so": Use XLA with an arbitrary PJRT. PJRT is a plugin system for XLA to support different hardware. One can install PJRTs built for NVIDIA GPUs (there is an installation script for that), there is also one for ROCm (not tested by the author), for TPU (Google Cloud) and reports of PJRTs being built to even new accelerators (e.g.: TensTorrent XLA)
    • For the native Go backend:
      • GOMLX_SIMD_AVX512: set to 0 or false to disable AVX512 SIMD implementation in the native Go backend. The default is enabled if AVX512 is present.
      • GOMLX_SIMD_AVX2: set to 0 or false to disable AVX2 SIMD implementation in the native Go backend. The default is enabled if AVX2 is present.
      • GOMLX_FUSION: if set to 0, false to disable fused operations in the native Go backend. The default is enabled.
    • For the XLA backend
      • PJRT_PLUGIN_LIBRARY_PATH: the underlying XLA backend uses this variable as an extra directory to search for plugin locations. It searches for the systems library paths ($LD_LIBRARY_PATH, /etc/ld.so.conf), the default /usr/local/lib/gomlx/pjrt and $PJRT_PLUGIN_LIBRARY_PATH if set.
      • GOMLX_NO_AUTO_INSTALL: if set to 1, GoMLX will not automatically install PJRTs when running on a system without them.
      • XLA_FLAGS: optional controls for XLA backend. It should be set to a semicolon (";") separated list of options. If you set to --help the backend will print out some help for all options. There is also a description on the page XLA Flags Guidance.
    • GOMLX_TENSOR_SUMMARY_SIZE: when a tensor is printed, it only displays by default the first and last 3 elements of each row. Set this to a number to change this default.
  • What backends to include when using GoMLX?
    • The recommendation is to use import _ "github.com/gomlx/gomlx/backends/default" which will import xla (or the alias stablehlo) and go backends. If you add -tags=noxla to the compiler it won't include the XLA backend.
    • import _ "github.com/gomlx/compute/gobackend" to include only go (no C++ dependencies)
    • import _ "github.com/gomlx/go-xla/compute/xla/autoinstall" to import only XLA (with the auto-installer).
  • Where are AI context files for (Gemini, Claude, SKILLS.md, etc.)
    • To prevent cluttering the root folder of the project, they are all moved to the .agents/ directory and also included in the .gitignore. This way one can simply symbolic link whichever AI configuration file they use to the root directory of their local copy to use them.

๐Ÿค Collaborating

The project is looking forward to contributions from anyone interested. Many parts are not yet set in stone, so there is plenty of space for improvements and re-designs for those interested and with good experience in Go, Machine Learning, and APIs in general. See the TODO file for inspiration.

No governance guidelines have been established yet.

See the section Support above to get in touch (Slack channel or Google Groups)!

๐Ÿ’– Support the Project

If you find this project helpful, please consider donating (using Stripe.com):

Your contribution helps us (currently mostly me) dedicate more time to maintenance and add new features for the entire GoMLX ecosystem.

It also helps us acquire access (buying or cloud) to hardware for more portability: e.g.: ROCm, Apple Metal (GPU), Multi-GPU/TPU, NVidia DGX Spark, Tenstorrent, etc.

And we are happy to prioritize features for donations.

๐Ÿš€ Advanced Topics

๐Ÿ’– Thanks

โš–๏ธ License

Copyright 2026 Jan Pfeifer & other GoMLX authors

GoMLX is distributed under the terms of the Apache License Version 2.0. Unless it is explicitly stated otherwise, any contribution intentionally submitted for inclusion in this project shall be licensed under Apache License Version 2.0 without any additional terms or conditions.

Directories ยถ

Path Synopsis
backends
default
Package _default includes the default backends, namely XLA and SimpleGo.
Package _default includes the default backends, namely XLA and SimpleGo.
cmd
convert_v0.28 command
convert_v0.28 faciliates the conversion of pre-v0.28 GoMLX code to the updated APIs in v0.28.0 release.
convert_v0.28 faciliates the conversion of pre-v0.28 GoMLX code to the updated APIs in v0.28.0 release.
gomlx_checkpoints command
gomlx_checkpoints reports back on model size (and memory) usage (--summary), individual variables shapes and sizes (--vars), hyperparameters used with the model (--params) or metrics collected during model training (--metrics, --metrics_labels).
gomlx_checkpoints reports back on model size (and memory) usage (--summary), individual variables shapes and sizes (--vars), hyperparameters used with the model (--params) or metrics collected during model training (--metrics, --metrics_labels).
core
graph
Package graph is the core package for GoMLX.
Package graph is the core package for GoMLX.
graph/graphtest
Package graphtest holds test utilities for packages that depend on the graph package.
Package graphtest holds test utilities for packages that depend on the graph package.
graph/nanlogger
Package nanlogger collects `graph.Node` objects to monitor for `NaN` ("not-a-number") or `Inf` (infinity) values.
Package nanlogger collects `graph.Node` objects to monitor for `NaN` ("not-a-number") or `Inf` (infinity) values.
tensors
Package tensors implement a `Tensor`, a representation of a multidimensional array.
Package tensors implement a `Tensor`, a representation of a multidimensional array.
tensors/bucketing
Package bucketing provides strategies for bucketing tensor dimensions to reduce the number of unique compiled graphs when input sizes vary.
Package bucketing provides strategies for bucketing tensor dimensions to reduce the number of unique compiled graphs when input sizes vary.
tensors/dtensor
Package distributed defines a dtensor.Tensor, a logical tensor distributed across multiple devices organized as a distributed.DeviceMesh.
Package distributed defines a dtensor.Tensor, a logical tensor distributed across multiple devices organized as a distributed.DeviceMesh.
tensors/images
Package images provides several functions to transform images back and forth from tensors.
Package images provides several functions to transform images back and forth from tensors.
tensors/numpy
Package numpy allows one to read/write tensors to Python's NumPy npy and npz file formats.
Package numpy allows one to read/write tensors to Python's NumPy npy and npz file formats.
examples module
gpt2 module
mxbai-rerank module
internal
cmd/constraints_generator command
constraint_generator prints out various lists of constraints used by generics, which can then be copy&pasted into the code.
constraint_generator prints out various lists of constraints used by generics, which can then be copy&pasted into the code.
cmd/trainer_aliases command
trainer_aliases prints out and writes the ModelFnCompatible constraints and createModelFnWrapper function.
trainer_aliases prints out and writes the ModelFnCompatible constraints and createModelFnWrapper function.
must
Package must provide a set of functions that check for errors and panic on error.
Package must provide a set of functions that check for errors and panic on error.
scoped
Package scoped provides a mapping from a string to any data type that is "scoped".
Package scoped provides a mapping from a string to any data type that is "scoped".
xlabuilderparser
Package xlabuilderparser parses the xlabuilder API to enumerate graph building functions, and the `op_types.txt` file to get a list of the supported ops.
Package xlabuilderparser parses the xlabuilder API to enumerate graph building functions, and the `op_types.txt` file to get a list of the supported ops.
ml
dataset
Package datasets is a collection of utility datasets (train.Dataset) that can be combined for efficient preprocessing: `Take`, `InMemory`, `Parallel`, `Map`, `MapOnHost`, `Freeing`.
Package datasets is a collection of utility datasets (train.Dataset) that can be combined for efficient preprocessing: `Take`, `InMemory`, `Parallel`, `Map`, `MapOnHost`, `Freeing`.
ggml
Package ggml provides graph-level decomposed dequantization for GGML block formats.
Package ggml provides graph-level decomposed dequantization for GGML block formats.
layers
Package layers holds a collection of common modeling layers.
Package layers holds a collection of common modeling layers.
layers/activation
Package activations implements several common activations, and includes a generic Apply method to apply an activation by its type.
Package activations implements several common activations, and includes a generic Apply method to apply an activation by its type.
layers/attention
Package attention implements multi-head attention and related utilities.
Package attention implements multi-head attention and related utilities.
layers/attention/kvcache
Package kvcache implements a flexible key-value (KV) cache for transformer models.
Package kvcache implements a flexible key-value (KV) cache for transformer models.
layers/attention/pos
Package pos provides positional encoding implementations for attention mechanisms.
Package pos provides positional encoding implementations for attention mechanisms.
layers/bspline
Package bsplines provide a GoMLX version of github.com/gomlx/bsplines: it provides evaluation of bsplines curves, that can be used as layers.
Package bsplines provide a GoMLX version of github.com/gomlx/bsplines: it provides evaluation of bsplines curves, that can be used as layers.
layers/fnn
Package fnn implements a generic FNN (Feedforward Neural Network) with various configurations.
Package fnn implements a generic FNN (Feedforward Neural Network) with various configurations.
layers/kan
Package kan implements a generic Kolmogorovโ€“Arnold Networks, as described in https://arxiv.org/pdf/2404.19756
Package kan implements a generic Kolmogorovโ€“Arnold Networks, as described in https://arxiv.org/pdf/2404.19756
layers/lstm
Package lstm provides a minimal "Long Short-Term Memory RNN" (LSTM) [1] implementation.
Package lstm provides a minimal "Long Short-Term Memory RNN" (LSTM) [1] implementation.
layers/norm
Package norm implements normalization layers for GoMLX, including Batch, Layer, and RMS normalization.
Package norm implements normalization layers for GoMLX, including Batch, Layer, and RMS normalization.
layers/rational
Package rational implements "learnable rational functions".
Package rational implements "learnable rational functions".
layers/regularizer
Package regularizers adds tools to facilitate add regularization to the weights learned.
Package regularizers adds tools to facilitate add regularization to the weights learned.
layers/vnn
Package vnn implements the Vector Neuron Networks operators described in https://arxiv.org/abs/2104.12229
Package vnn implements the Vector Neuron Networks operators described in https://arxiv.org/abs/2104.12229
model
Package model implements a model's Store object (to store variables and hyperparameters), Scope's (scope, like a directory "path") within a store, and Exec, an executor that takes as an extra parameter a Store and will handle passing the variables automatically as extra inputs and outputs to the graph being built.
Package model implements a model's Store object (to store variables and hyperparameters), Scope's (scope, like a directory "path") within a store, and Exec, an executor that takes as an extra parameter a Store and will handle passing the variables automatically as extra inputs and outputs to the graph being built.
model/checkpoint
Package checkpoint implements checkpoint management: saving and loading of checkpoints to file, or loading a checkpoint from an embedded checkpointHandler.
Package checkpoint implements checkpoint management: saving and loading of checkpoints to file, or loading a checkpoint from an embedded checkpointHandler.
model/initializer
Package initializer include several weight initializers, that can be used to initialize varariables, or used in model.Scope objects as default initializer for new variables.
Package initializer include several weight initializers, that can be used to initialize varariables, or used in model.Scope objects as default initializer for new variables.
model/modeltest
Package modeltest holds test utilities for packages that depend on model package.
Package modeltest holds test utilities for packages that depend on model package.
nn
train
Package train holds tools to help run a training loop.
Package train holds tools to help run a training loop.
train/loss
Package losses have several standard losses that implement train.LossFn interface.
Package losses have several standard losses that implement train.LossFn interface.
train/metric
Package metrics holds a library of metrics and defines
Package metrics holds a library of metrics and defines
train/optimizer
Package optimizer implements a collection of ML optimizers that can be used by train.Trainer, or by themselves.
Package optimizer implements a collection of ML optimizers that can be used by train.Trainer, or by themselves.
train/optimizer/cosineschedule
Package cosineschedule implements a cosine annealing schedule for the learning rate.
Package cosineschedule implements a cosine annealing schedule for the learning rate.
zoo/transformer/generate
Package generate implements a generator for transformer models, including the sampling strategies: greedy, top-k, top-p and beam search.
Package generate implements a generator for transformer models, including the sampling strategies: greedy, top-k, top-p and beam search.
zoo/transformer/generate/sample
Package sample provides various sampling strategies for autoregressive generation.
Package sample provides various sampling strategies for autoregressive generation.
support
exceptions
Package exceptions provide helper functions to leverage Go's `panic`, `recover` and `defer` as an "exceptions" system.
Package exceptions provide helper functions to leverage Go's `panic`, `recover` and `defer` as an "exceptions" system.
fsutil
Package fsutil contains utilities for working with the file system.
Package fsutil contains utilities for working with the file system.
sets
Package sets implements a set type as a `map[T]struct{}` but with better ergonomics.
Package sets implements a set type as a `map[T]struct{}` but with better ergonomics.
testutil
Package testutil provides utility functions for testing.
Package testutil provides utility functions for testing.
xslices
Package xslices provide missing functionality to the slices package.
Package xslices provide missing functionality to the slices package.
xsync
Package xsync implements some extra synchronization tools.
Package xsync implements some extra synchronization tools.
ui
bashkernel
Package bashkernel implements tools to output rich content to a Jupyter notebook running the bash_kernel (https://github.com/takluyver/bash_kernel).
Package bashkernel implements tools to output rich content to a Jupyter notebook running the bash_kernel (https://github.com/takluyver/bash_kernel).
commandline
Package commandline contains convenience UI training tools for the command line.
Package commandline contains convenience UI training tools for the command line.
gonb/margaid
Package margaid implements automatic plotting of all metrics registered in a trainer, using the Margaid library (https://github.com/erkkah/margaid/) to draw SVG, and GoNB (https://github.com/janpfeifer/gonb/) to display it in a Jupyter Notebook.
Package margaid implements automatic plotting of all metrics registered in a trainer, using the Margaid library (https://github.com/erkkah/margaid/) to draw SVG, and GoNB (https://github.com/janpfeifer/gonb/) to display it in a Jupyter Notebook.
gonb/plotly
Package plotly uses GoNB plotly support (`github.com/janpfeifer/gonb/gonbui/plotly`) to plot both on dynamic plots while training or to quickly plot the results of a previously saved plot results in a checkpoint directory.
Package plotly uses GoNB plotly support (`github.com/janpfeifer/gonb/gonbui/plotly`) to plot both on dynamic plots while training or to quickly plot the results of a previously saved plot results in a checkpoint directory.
notebooks
Package notebooks allows one to check if running within a notebook.
Package notebooks allows one to check if running within a notebook.
plot
Package plots define common types and utilities to the different plot libraries.
Package plots define common types and utilities to the different plot libraries.

Jump to

Keyboard shortcuts

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