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_namein config - Use the
stages=[...]argument to chain:op1 >> op2 >> op3 - All operators work inside
jax.jitfor 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:
- element_operator - Element-level transformations with full access
- map_operator - Per-array-leaf map transformations
- composite_operator - Compose multiple operators (11 strategies)
- batch_mix_operator - MixUp and CutMix augmentation
- probabilistic_operator - Apply operators with probability
- selector_operator - Random operator selection
Image Operators¤
Specialized operators for image data transformations:
- brightness_operator - Brightness adjustments
- contrast_operator - Contrast modifications
- dropout_operator - Pixel dropout regularization
- noise_operator - Gaussian/uniform noise injection
- patch_dropout_operator - Patch-level dropout
- rotation_operator - Image rotation transforms
- functional - Functional image operations (stateless)
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¤
- DADA Learned Augmentation - 15 augmentation operators composed with Gumbel-Softmax for differentiable policy search
- Learned ISP Pipeline - 5 custom
ModalityOperatorISP stages with learnablennx.Paramparameters - DDSP Audio Synthesis - Custom
OperatorModulesubclasses for audio DSP, extending datarax beyond images
See Also¤
- Element Operator Guide - Detailed element operator docs
- Composite Operator Guide - Composition strategies
- DAG Executor - Using operators in pipelines
- Operators Tutorial