Examples Overview

September 11, 2026 ยท View on GitHub

Datarax provides a full set of examples organized by complexity and topic. Each example follows a consistent structure with learning goals, prerequisites, and expected outcomes.

Quick Start

Example Categories

Core Pipeline

Essential examples for understanding Datarax fundamentals.

ExampleLevelDescription
Simple PipelineBeginnerBasic pipeline with memory source and operators
Pipeline TutorialIntermediateThorough guide to operators and composition
Operators TutorialIntermediateDeep dive into operator types and patterns
CIFAR-10 Quick ReferenceBeginnerCIFAR-10 dataset loading and preprocessing
Augmentation Quick ReferenceBeginnerImage augmentation techniques
MNIST TutorialIntermediateComplete MNIST training pipeline
Fashion AugmentationIntermediateFashion-MNIST with advanced augmentation
Composition StrategiesIntermediateAll 11 operator composition patterns
Advanced OperatorsIntermediateProbabilistic, selector, and patch dropout operators

Integration

Connect Datarax with external data sources and libraries.

ExampleLevelDescription
HuggingFace Quick ReferenceBeginnerLoad datasets from HuggingFace Hub
HuggingFace TutorialIntermediateAdvanced HF usage and training pipelines
IMDB ExampleBeginnerText classification with IMDB dataset
TFDS Quick ReferenceBeginnerLoad datasets from TensorFlow Datasets
ArrayRecord Quick ReferenceIntermediateGoogle's ArrayRecord format integration

Differentiable Pipelines (Why Datarax)

Flagship examples demonstrating datarax's unique differentiable pipeline capabilities.

Advanced

Production-ready patterns and optimization techniques.

ExampleLevelDescription
MixUp & CutMix TutorialIntermediateBatch-level mixing augmentations
Checkpoint Quick ReferenceIntermediateSave and restore pipeline state
Resumable Training GuideAdvancedFull checkpointing workflow
DAG Fundamentals GuideAdvancedDeep dive into DAG pipeline architecture
Branching DAG CookbookIntermediateBranch / Merge / Parallel recipes via Pipeline.from_dag
Sharding Quick ReferenceIntermediateMulti-device data distribution
Sharding GuideAdvancedAdvanced distributed training patterns
Interleaved TutorialIntermediateMultiple data source mixing
Optimization GuideAdvancedPerformance tuning and profiling
Sampling TutorialIntermediateSequential, shuffle, range, and epoch-aware samplers
End-to-End CIFAR-10AdvancedComplete training pipeline with all features
DADA Learned AugmentationAdvancedDifferentiable augmentation policy search
Learned ISP GuideAdvancedEnd-to-end ISP optimization for object detection
DDSP Audio SynthesisAdvancedCustom operators for differentiable audio processing

Documentation Tiers

Datarax examples follow a three-tier documentation pattern:

Tier 1: Quick Reference (~5-10 min)

  • Minimal code, maximum clarity
  • Single focused concept
  • Copy-paste ready snippets
  • Ideal for: Getting started, quick lookups

Tier 2: Tutorial (~30-60 min)

  • Step-by-step instruction
  • Multiple related concepts
  • Hands-on practice exercises
  • Ideal for: Learning new features

Tier 3: Advanced Guide (~60+ min)

  • Deep dive into internals
  • Performance optimization
  • Production considerations
  • Ideal for: Expert users, complex use cases

Feature Coverage

The examples cover all major Datarax features:

Feature AreaExamplesCoverage
Data SourcesMemory, HuggingFace, TFDS, ArrayRecordComplete
OperatorsElement, Batch, Probabilistic, Selector, Patch DropoutComplete
CompositionLinear stages and branching DAGs via Pipeline and Pipeline.from_dagComplete
SamplersSequential, Shuffle, Range, EpochAwareComplete
DAG PipelineLinear stages=[...] and Pipeline.from_dag topologiesComplete
DistributedSharding, Multi-deviceComplete
CheckpointingState save/restore, Resumable trainingComplete
MonitoringMetrics, Reporters, CallbacksComplete
Differentiable PipelinesDADA, ISP, DDSPComplete

Running Examples

All examples are available as both Python scripts and Jupyter notebooks.

As Python Scripts

# Activate environment
source activate.sh

# Run any example
python examples/core/01_simple_pipeline.py

As Jupyter Notebooks

# Start Jupyter
uv run jupyter lab

# Navigate to examples/ directory

Generating Notebooks from Scripts

# Convert a single file
python scripts/jupytext_converter.py py-to-nb examples/core/01_simple_pipeline.py

# Batch convert directory
python scripts/jupytext_converter.py batch-py-to-nb examples/core/

Prerequisites

Before running examples, ensure you have:

  1. Datarax installed: uv pip install datarax
  2. JAX configured: GPU support recommended for performance
  3. Environment activated: source activate.sh

For external data sources:

  • HuggingFace: uv pip install "datarax[data]"
  • TFDS: uv pip install "datarax[data]"
  • ArrayRecord: uv pip install "datarax[data]" array-record

For Contributors

Want to add your own examples? We welcome contributions!

Quick Start for Contributors

  1. Read the Example Documentation Design Guide
  2. Copy the template from examples/_templates/example_template.py
  3. Follow the 7-part structure and quality checklist
  4. Submit a PR with .py, generated .ipynb, and .md documentation files

Next Steps