The ML framework where bugs are caught before runtime, not after deployment.
Quick Start | User Guide | Developer Guide | Release Checklist | Vision | Roadmap | API Reference
Axiom.jl is a revolutionary machine learning framework that combines:
- Julia's expressiveness - Write models as mathematical expressions
- Rust's performance - Production-grade speed and safety
- Formal verification - Prove properties about your models
- PyTorch compatibility - Import existing models seamlessly
@axiom ImageClassifier begin
input :: Tensor{Float32, (224, 224, 3)}
output :: Probabilities(1000)
features = input |> ResNet50(pretrained=true) |> GlobalAvgPool()
output = features |> Dense(2048, 1000) |> Softmax
# These are GUARANTEED at compile time
@ensure sum(output) ≈ 1.0
@ensure all(output .>= 0)
end# PyTorch: Fails at runtime (after you've waited 3 hours for training)
class BrokenModel(nn.Module):
def __init__(self):
self.conv1 = nn.Conv2d(3, 64, 3)
self.fc1 = nn.Linear(100, 10) # Wrong size!
def forward(self, x):
x = self.conv1(x)
x = self.fc1(x) # RuntimeError: size mismatch
return x# Axiom.jl: Fails at COMPILE time (immediately)
@axiom BrokenModel begin
input :: Tensor{Float32, (224, 224, 3)}
features = input |> Conv(64, (3,3))
output = features |> Dense(10) # COMPILE ERROR!
# Shape mismatch: Conv output is (222, 222, 64)
# Dense expects vector. Add Flatten layer.
endResult: Hours saved. Bugs caught. Sleep restored.
using Pkg
Pkg.add("Axiom")using Axiom
# Define a verified model
model = Sequential(
Dense(784, 256, relu),
Dense(256, 10),
Softmax()
)
# Run inference
output = model(randn(Float32, 32, 784))
# Verify properties
@ensure all(sum(output, dims=2) .≈ 1.0)using Axiom
# Define and verify a model
model = Sequential(
Dense(784, 128, relu),
Dense(128, 10),
Softmax()
)
sample = Tensor(randn(Float32, 16, 784))
batch = [(sample, nothing)]
result = verify(model, properties=[ValidProbabilities(), FiniteOutput()], data=batch)Axiom is Julia-first. The optional Zig backend provides native SIMD kernels for
high-performance hot paths and is used only when you explicitly enable it
(e.g. compile(model, backend=ZigBackend(path))). Most users can ignore it entirely.
| Feature | PyTorch | TensorFlow | Axiom.jl |
|---|---|---|---|
| Shape checking | Runtime | Runtime | Compile time |
| Formal proofs | No | No | Yes |
| REPL exploration | No | No | Yes |
| Performance | Good | Good | Competitive (Zig)† |
| Safety certification | No | No | Yes |
| Learning curve | Low | Medium | Low |
† Performance is workload-dependent: Axiom's Zig SmartBackend is competitive with PyTorch on small/medium ops and behind on large element-wise ops (geomean ~0.73×). See
benchmark/results_2026-02-20_framework-comparison.md.
- User Guide - Installation and day-1 workflows
- Developer Guide - Local development, checks, release flow
- Release Checklist - Pre-release and release-day checklist
- Vision & Philosophy - Why Axiom.jl exists
- Tutorials - From beginner to expert
- PyTorch Migration - Coming from PyTorch?
- FAQ - Common questions answered
- @axiom DSL - The declarative model definition
- Verification System - @ensure and @prove
- Architecture - Deep dive into design
- Performance Tuning - Backend selection and optimization
- Complete API Reference - All functions, types, macros
- Layers - Dense, Conv, Pool, etc.
- Activations - ReLU, GELU, Softmax, etc.
- Optimizers - Adam, SGD, etc.
- Loss Functions - CrossEntropy, MSE, etc.
- Performance Tuning - Optimize for speed
- Safety-Critical Applications - FDA, ISO 26262, DO-178C
- Certification Readiness - Compliance checklists by domain
- Deployment Guide - Server, edge, cloud
- Ecosystem & Integrations - Connect to Julia/Python world
- Framework Comparison - vs PyTorch, TensorFlow, JAX
Try these in your Julia REPL:
Example 1: Image Classification
using Axiom
@axiom CIFAR10Classifier begin
input :: Image(32, 32, 3)
output :: Probabilities(10)
# Convolutional feature extractor
conv1 = input |> Conv(32, (3,3), padding=:same) |> BatchNorm() |> ReLU
conv2 = conv1 |> Conv(64, (3,3), padding=:same) |> BatchNorm() |> ReLU
pool1 = conv2 |> MaxPool((2,2))
conv3 = pool1 |> Conv(128, (3,3), padding=:same) |> BatchNorm() |> ReLU
pool2 = conv3 |> MaxPool((2,2))
# Classifier head
flat = pool2 |> GlobalAvgPool()
output = flat |> Dense(128, 10) |> Softmax
@ensure valid_probabilities(output)
end
model = CIFAR10Classifier()Example 2: Transformer Block
using Axiom
@axiom TransformerBlock begin
input :: Tensor{Float32, (:batch, :seq, 512)}
output :: Tensor{Float32, (:batch, :seq, 512)}
# Multi-head attention
attn = input |> MultiHeadAttention(heads=8, dim=512)
add1 = input + attn # Residual connection
norm1 = add1 |> LayerNorm(512)
# Feed-forward
ff = norm1 |> Dense(512, 2048, gelu) |> Dense(2048, 512)
add2 = norm1 + ff # Residual connection
output = add2 |> LayerNorm(512)
@ensure shape(output) == shape(input)
endExample 3: Verified Medical AI
using Axiom
@axiom MedicalDiagnosis begin
input :: MedicalImage(512, 512, 1)
output :: Diagnosis(5) # 5 possible conditions
# Feature extraction
features = input |> ResNet50(pretrained=true)
# Classifier
output = features |> Dense(2048, 5) |> Softmax
# CRITICAL: Medical safety guarantees
@ensure valid_probabilities(output)
@ensure no_nan(output)
@ensure confidence_bounded(output, min=0.6) # Require high confidence
# For FDA approval: formal properties
@prove ∀x. sum(output(x)) == 1.0
@prove ∀x ε. (ε < 0.01) ⟹ stable(output(x), output(x + ε))
endPerformance comparison on common tasks:
| Task | PyTorch | Axiom.jl (Julia) | Axiom.jl (Rust) |
|---|---|---|---|
| MNIST training | 1.0x | 1.1x | 1.8x |
| ResNet inference | 1.0x | 0.9x | 2.3x |
| BERT inference | 1.0x | 1.0x | 2.1x |
| Compilation | 30s | 2s | 5s |
Benchmarks on Intel i9-12900K, RTX 3090. Your mileage may vary.
- GitHub Discussions - Questions and ideas
- Discord - Real-time chat
- Twitter - Updates and news
- Contributing - Help us build the future
- Read the Vision - Understand why we built this
- Install Axiom.jl - Get started in 2 minutes
- Build Your First Model - Hands-on tutorial
- Join the Community - Get help and share
Built with by the Axiom.jl team
The future of ML is verified.