Skip to content
CAI
Software that uses CAICheck a score

elixir-nx/axon

65.6

Adequate · 23 September 2026

15.8k

lines of production code

Elixir

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Axon is a neural network library for Elixir that provides a functional API for defining, training, and executing deep learning models. It integrates with the Nx ecosystem to support diverse architectures, including vision, text, and generative models, while leveraging EXLA and TorchX for hardware-accelerated computation. The system offers comprehensive tooling for model serialization, optimization via Polaris, and interactive development through Livebook notebooks.

How it got here

2021 — Nx 1.0 ecosystem migration and API overhaul

8 changes.

The project upgraded to the Nx 1.0 ecosystem and Elixir 1.20, introducing a new functional layer API and block-based definitions to replace the previous architecture. This period focused on stabilizing the core library with comprehensive documentation and test coverage while expanding practical usage through diverse examples in vision, generative AI, and fraud detection.

2022 — Documentation and test expansion

9 changes.

This period focused on expanding the Axon library's documentation and test coverage through a comprehensive set of Livebook guides and example notebooks. The work included adding extensive unit and integration tests for core components while introducing new tutorials on model creation, training, serialization, and various AI applications like vision and text generation.

2023–2026 — Axon documentation and examples expansion

4 changes.

This period focused on expanding the project's educational resources by adding new example notebooks and scripts for time-series and text analysis tasks. It also included the creation of a migration cheatsheet to assist PyTorch developers in transitioning to Axon, alongside routine updates to test fixtures.

Features

Add Axon to PyTorch migration cheatsheet

A new cheatsheet has been added to the guides section to help PyTorch developers transition to Elixir and Axon. It provides side-by-side code examples and explanations for common neural network tasks, highlighting key paradigm differences such as functional versus object-oriented model definition, and mapping equivalent commands for layers like Dense, Convolutional, Pooling, Dropout, and Normalization.

guides/cheatsheets · high confidence

Add LSTM text generation notebook with Gutenberg data download

A new notebook demonstrating text generation using an LSTM neural network has been added. It utilizes the Axon library for model definition and EXLA for compilation, training on data downloaded from Project Gutenberg. The notebook includes specific SSL configuration for the HTTP client to handle TLS 1.3 connections when fetching the source text.

notebooks/text · high confidence

Add XOR neural network modeling notebook

A new notebook has been added to the basics section that demonstrates how to model the logical XOR operation using a neural network. It guides users through defining a sequential model with Axon, generating training data, training the model with binary cross-entropy and SGD, and visualizing the learned non-linear decision boundaries using VegaLite.

notebooks/basics · high confidence

Add bidirectional LSTM example for IMDB sentiment analysis

A new example script demonstrates a bidirectional LSTM model for IMDB sentiment analysis, ported from Keras to Axon. The implementation includes a custom parameter initialization module to match Keras's specific LSTM weight and bias configurations, ensuring comparable training behavior and accuracy against the original reference.

examples/text · high confidence

Add credit card fraud detection example

A new example script has been added to the structured examples directory that demonstrates how to build and train a binary classification model for detecting credit card fraud. The script uses Axon to define a neural network, Polaris for optimization, and Explorer for data handling, illustrating a complete workflow from loading and normalizing CSV data to training with a weighted binary cross-entropy loss and evaluating performance metrics.

examples/structured · high confidence

Add generative AI and structured data example notebooks

New example notebooks have been added to the documentation to demonstrate practical applications of the Axon library. The generative section includes \fashionmnist\_autoencoder.livemd\ for basic autoencoders, \fashionmnist\_vae.livemd\ for variational autoencoders with custom layers and early stopping, and \mnist\_autoencoder\_using\_kino.livemd\ for denoising autoencoders with interactive visualization. Additionally, \credit\_card\_fraud.livemd\ in the structured section demonstrates building a classifier for imbalanced datasets using Explorer and Polaris optimizers.

notebooks/generative · high confidence

Add time-series regression example notebook

A new interactive notebook has been added to the time-series examples demonstrating how to build a predictor for Apple's stock prices using a Recurrent Neural Network (RNN). The guide walks users through loading historical data, applying min-max normalization, creating sliding windows for input-output pairs, and training an LSTM model using the Axon library.

_notebooks/time\series · high confidence

Introduce functional layer API and block-based layer definitions

Axon now provides a new functional layer API (\Axon.Layers\) and a block definition system (\Axon.Block\) that allows layers to be defined as reusable \Nx.block\ structures. This change introduces foundational components for the neural network library, including activation functions (\Axon.Activations\), initializers (\Axon.Initializers\), loss functions (\Axon.Losses\), and metrics (\Axon.Metrics\), all implemented as numerical functions compatible with JIT/AOT compilation. The compiler (\Axon.Compiler\) and training loop (\Axon.Loop\) have been updated to support this new architecture, enabling more modular and composable model definitions.

lib/axon · high confidence

New Axon model creation and execution guides

Added a comprehensive set of Livebook documentation guides in the \guides/model\_creation\ and \guides/model\_execution\ directories. These new files cover sequential, complex, multi-input/multi-output, and custom layer model architectures, as well as model hooks for debugging. The execution guides explain how to accelerate models using Nx backends (EXLA, TorchX) and compilers, and detail the differences between training and inference modes, including stateful layer behavior.

_guides/model\creation · high confidence

New Axon training and evaluation guides

Added a set of new Livebook documentation guides in the \guides/training\_and\_evaluation\ directory. These guides cover creating and running supervised training loops (\Axon.Loop.trainer\), evaluation loops (\Axon.Loop.evaluator\), and advanced loop instrumentation including custom metrics, event handlers, and custom loss functions.

_guides/training\_and\evaluation · high confidence

New basic examples for multi-input and multi-output models

Added two new example scripts in the basics directory demonstrating how to handle complex model architectures. The multi-input example shows how to define and train a model with multiple inputs (concatenating two input streams) for an XOR classification task, while the multi-output example illustrates building a model with multiple outputs (predicting x^2 and x^3) using a containerized output structure and combined loss functions.

examples/basics · high confidence

New documentation guides for Axon model serialization and ONNX conversion

Added two new Livebook guides in the serialization documentation area: one demonstrating how to convert ONNX models to Axon using the \axon\_onnx\ library, and another detailing the recommended parameters-only approach for saving and loading Axon models via \Nx.serialize/2\ and \Nx.deserialize/2\, including checkpointing and resuming training workflows.

guides/serialization · high confidence

New generative AI examples for autoencoding, GANs, and text generation

The examples/generative directory now includes three new standalone scripts demonstrating generative modeling capabilities: a Fashion MNIST autoencoder, a MNIST GAN, and an LSTM-based text generator. These examples utilize the Axon library for model definition and training loops, with the GAN and text generator also leveraging the Polaris library for optimizer updates. They showcase practical implementations of latent space encoding, adversarial training dynamics, and sequence prediction using Elixir and Nx.

examples/generative · high confidence

New vision notebooks for classification, metric learning, and MNIST

Added three new Livebook notebooks in the vision directory: 'horses\_or\_humans.livemd' demonstrates a CNN for binary image classification using the Horses or Humans dataset; 'metric-learning.livemd' implements metric learning on CIFAR-10 to create image embeddings for similarity search; and 'mnist.livemd' provides a basic guide to training a neural network on handwritten digits. These notebooks serve as updated examples for using the Axon library for various computer vision tasks.

notebooks/vision · high confidence

New vision training examples for CIFAR-10, MNIST, and image classification

Added new executable examples in the vision directory demonstrating how to train neural networks using the Axon library. The CIFAR-10 example shows a convolutional network for image classification, while the MNIST example demonstrates a simple dense network. A new Horses or Humans example illustrates training with custom image data and gradient centralization via Polaris. Additionally, a CNN image denoising example shows how to build an encoder-decoder model for removing noise from MNIST images, and a ResNet50 model definition is provided as a reference architecture.

examples/vision · high confidence

Behavioural changes

Axon library documentation and module structure overhaul

The \lib/axon.ex\ module has been completely rewritten to replace the previous placeholder documentation with a comprehensive guide on creating and executing neural network models. The new documentation details the high-level API for building models using inputs, layers, and containers, explains how to handle multiple inputs and outputs, and provides instructions for defining custom layers. It also covers model execution via \Axon.build/2\ and \Axon.compile/4\, including configuration of compilers and training modes.

lib · high confidence

Axon v0.9.0: Upgrade to Nx 1.0 ecosystem and Elixir 1.20

This release upgrades the library to the Nx 1.0 ecosystem (including EXLA and Torchx) and requires Elixir 1.20.2 with Erlang/OTP 27.3. For users, this means the model serialization API has changed: \Axon.serialize/2\ and \Axon.deserialize/2\ are removed in favor of \Nx.serialize/2\ and \Nx.deserialize/2\, and the optimization modules (\Axon.Optimizers\, \Axon.Schedules\, \Axon.Updates\) are deprecated in favor of the Polaris library. The formatter configuration has also been updated to import Nx dependencies and handle \defn\/\defnp\ locals.

(repo-wide) · high confidence

Test coverage

1 commit adding/updating tests in test/fixtures; Comprehensive test suite for Axon core components; Expanded test coverage for Axon layers and JIT backend configuration.

Dependencies

Axon 0.9.0: Major dependency upgrades and Elixir 1.13 requirement

Axon has been updated to version 0.9.0, raising the minimum Elixir requirement to 1.13. The core Nx dependency has been upgraded to version 1.0, and EXLA and Torchx have also been bumped to their 1.0 releases, moving them from git sources to Hex packages. Additional dependencies such as ExDoc, Kino, and Tablex have been updated to their latest compatible versions to support improved documentation and optional interactive features.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 57 → 66 (+8.3)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 91 → 94 (+3.2)
  • Architecture 100 → 100 (+0.0)
  • Maturity 58 → 58 (+0.0)
  • Readiness 46 → 58 (+12.2)
  • Security 63 → 78 (+15.5)

Resolved (27)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — no supported dependency manifest was read
  • Duplicated block (10 lines × 2) (lib/axon/compiler.ex)
  • Duplicated block (12 lines × 2) (lib/axon.ex)
  • Duplicated block (13 lines × 2) (lib/axon.ex)
  • Duplicated block (13 lines × 2) (lib/axon/model_state.ex)
  • Duplicated block (16 lines × 2) (lib/axon.ex)
  • Duplicated block (16 lines × 2) (lib/axon/shape.ex)
  • Duplicated block (16 lines × 3) (lib/axon.ex)
  • Duplicated block (18 lines × 2) (lib/axon.ex)
  • Duplicated block (18 lines × 2) (lib/axon.ex)
  • Duplicated block (7 lines × 3) (examples/vision/resnet50.exs)
  • Duplicated block (8 lines × 2) (lib/axon.ex)
  • Duplicated block (9 lines × 2) (lib/axon.ex)
  • Duplicated block (9 lines × 2) (lib/axon/loop.ex)
  • FileTooLong: axon/initializers.ex (lib/axon/initializers.ex)
  • FileTooLong: axon/losses.ex (lib/axon/losses.ex)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • …and 7 more

New (65)

  • Compiler.recur_model_funs (cognitive 17) (lib/axon/compiler.ex)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (10 lines × 2) (lib/axon/loop.ex)
  • Duplicated block (11 lines × 2) (lib/axon.ex)
  • Duplicated block (11 lines × 2) (lib/axon/compiler.ex)
  • Duplicated block (11 lines × 2) (lib/axon/compiler.ex)
  • Duplicated block (11–19 lines × 3) (lib/axon/compiler.ex)
  • Duplicated block (14–15 lines × 3) (lib/axon.ex)
  • Duplicated block (15–21 lines × 2) (lib/axon.ex)
  • Duplicated block (17 lines × 3) (lib/axon.ex)
  • Duplicated block (19 lines × 2) (lib/axon.ex)
  • Duplicated block (19 lines × 2) (lib/axon/shape.ex)
  • Duplicated block (20 lines × 2) (lib/axon.ex)
  • Duplicated block (23–29 lines × 3) (lib/axon.ex)
  • Duplicated block (24 lines × 2) (lib/axon.ex)
  • Duplicated block (27–31 lines × 2) (lib/axon/compiler.ex)
  • Duplicated block (5 lines × 2) (examples/generative/fashionmnist_autoencoder.exs)
  • Duplicated block (6 lines × 2) (examples/vision/cifar10.exs)
  • Duplicated block (6 lines × 3) (examples/vision/resnet50.exs)
  • …and 45 more

Changes since last survey

  • 17 commits — 16 feature/other, 1 fixes

By area

  • lib/axon — 8 commits
  • (root) — 3 commits
  • lib/axon.ex — 2 commits
  • test/axon — 2 commits
  • examples/vision — 1 commit
  • guides/training_and_evaluation — 1 commit

Notable commits

  • fix: Fix RNN unrolling gradients and bidirectional LSTMs (#646)
  • change: Add Axon.deferred/2 (#651)
  • change: Add Axon.elem/3 and Axon.fetch/3 container accessors (#653)
  • change: Add Axon.namespace/2 and /3 (#652)
  • change: Add SwiGLU activation (#642)
  • change: Annotate activation functions with Nx blocks (#639)
  • change: Default Axon.scale/2 to a ones initializer (#649)
  • change: Define Axon.ModelState functions as transforms (#656)
  • change: Donate step state buffers during training (#645)
  • change: Improve shape mismatch errors in training loops (#662)
  • change: Log iteration instead of batch in Axon.Loop progress output (#659)
  • change: Remove loop output transforms (#657)
  • change: Support container outputs in eval_step and Axon.Display (#647)
  • change: Support grouped transposed convolutions (#648)
  • change: chore: Update to Nx, EXLA and Torchx 1.0 (#671)
  • change: chore: update to 0.9 (Nx 1.0)
  • change: chore: update to nx 0.13 (#641)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

elixir-nx/axon was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 23 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit a83d906f45f843a64c20138ca636b3bea6ae9253 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-955b9cee9818.