Skip to main content
Ctrl+K
This site covers the new Flax NNX API. [Click here for the old Flax Linen API]
 - Home  - Home
  • Flax basics
  • MNIST tutorial
  • Why Flax NNX?
  • JAX/Flax Key Concepts
  • Basic Guides
    • Module & Pytree
    • Transformations
    • Model Views
    • Filters
    • Randomness
    • Save and load checkpoints
    • Data Loaders
    • Flax NNX vs JAX transformations
  • Advanced Guides
    • Scale up on multiple devices
    • Performance considerations
    • Use Flax NNX and Linen together
    • Model surgery
    • Extracting intermediate values
    • A Flax Optimization Cookbook
  • Post-training (Tunix)
  • Hijax (experimental)
    • Hijax
  • Migrating
    • From PyTorch to Jax and Flax
    • NNX 0.10 to NNX 0.11
    • Flax Linen to Flax NNX
    • Haiku to Flax NNX
  • Examples
    • Example: Using pretrained Gemma for inference with Flax NNX
    • Example: Train a diffusion model for image generation
    • Train a miniGPT language model with JAX
    • Example: Train a Vision Transformer (ViT) for image classification
    • Example: Image segmentation with UNETR model
  • Flax NNX glossary
  • The Flax philosophy
  • How to contribute
  • API Reference
    • flax.nnx
      • graph
      • compat
      • object
      • module
      • nn
        • Activation functions
        • Attention
        • Dtypes
        • Initializers
        • Linear
        • LoRA
        • Normalization
        • Pooling functions
        • Recurrent
        • Stochastic
      • rnglib
      • spmd
      • state
      • training
        • Metrics
        • Optimizer
        • EMA
      • transforms
      • variables
      • helpers
      • visualization
      • filterlib
      • bridge
    • flax.core.frozen_dict package
    • flax.struct package
    • flax.training package
  • .rst

training

training#

Experimental API. See the NNX page for more details.

  • Metrics
    • Metric
      • Metric.__init__()
      • Metric.compute()
      • Metric.reset()
      • Metric.update()
    • Average
      • Average.__init__()
      • Average.compute()
      • Average.reset()
      • Average.update()
    • Accuracy
      • Accuracy.update()
    • Welford
      • Welford.__init__()
      • Welford.compute()
      • Welford.reset()
      • Welford.update()
    • MultiMetric
      • MultiMetric.__init__()
      • MultiMetric.compute()
      • MultiMetric.reset()
      • MultiMetric.update()
  • Optimizer
    • Optimizer
      • Optimizer.step
      • Optimizer.tx
      • Optimizer.opt_state
      • Optimizer.__init__()
      • Optimizer.update()
  • EMA
    • EMA
      • EMA.decay
      • EMA.warmup_steps
      • EMA.count
      • EMA.filter
      • EMA.params
      • EMA.__init__()
      • EMA.update()

previous

state

next

Metrics

By The Flax authors

© Copyright 2023-Present, The Flax authors.