Skip to content

Operators¤

Data transformation operators for building processing pipelines. Operators are the workhorses of Datarax - they transform, augment, and process data as it flows through your pipeline.

Operator Types¤

Type Description Use Case
ElementOperator Full element access Coordinated multi-field transforms
MapOperator Per-array-leaf transforms Simple field-wise operations
CompositeOperator Compose multiple operators Complex augmentation pipelines
BatchMixOperator Batch-level mixing MixUp, CutMix augmentation

★ Insight ─────────────────────────────────────

  • Deterministic operators are pure functions (same input → same output)
  • Stochastic operators use RNG and require stream_name in config
  • Use the stages=[...] argument to chain: op1 >> op2 >> op3
  • All operators work inside jax.jit for performance

─────────────────────────────────────────────────

Quick Start¤

from datarax.operators import ElementOperator, CompositeOperatorModule
from datarax.core.config import ElementOperatorConfig

# Simple element transformation
def normalize(element, key):
    return element.replace(
        data={"image": element.data["image"] / 255.0}
    )

config = ElementOperatorConfig(stochastic=False)
op = ElementOperator(config, fn=normalize)

Core Operators¤

Base operator types for building data pipelines:

Image Operators¤

Specialized operators for image data transformations:

Composition Strategies¤

Strategies for combining operators in CompositeOperatorModule:

  • sequential - Chain operators in sequence
  • parallel - Apply operators in parallel, merge results
  • branching - Conditional routing based on data
  • ensemble - Ensemble multiple operators with reduction
  • merging - Output merging strategies (concat, sum, mean)
  • base - Base strategy interface

Real-World Examples¤

See Also¤