Expand description
Stateless and stateful transform traits plus built-in transforms. Transform - composable operations on samples.
Transforms are the second community extension point. Built-in transforms cover the common cases (map, filter, shuffle, batch). Community transforms can add augmentation, normalization, tokenization, etc.
§Stateless vs Stateful
-
[
Transform]: Stateless transforms process samples independently. They run in parallel across worker threads. Examples:map,filter,flat_map. -
[
StatefulTransform]: Stateful transforms maintain internal buffers and require ordered processing. They run serially in the collector thread. Examples:shuffle,batch.
Structs§
- Batch
Accumulator - Batch transform - accumulate N samples into a group.
- Filter
Transform - Filter transform - keep only samples that match a predicate.
- Flat
MapTransform FlatMaptransform - apply a function that yields zero or more samples.- MapTransform
- Map transform - apply a function to each sample.
- Shuffle
Buffer - Shuffle transform - randomize sample order using a reservoir buffer.
Enums§
- Transform
Result - Result of applying a transform to a sample.
Traits§
- Stateful
Transform - A stateful transform that can buffer, reorder, or group samples.
- Transform
- A stateless transform that operates on individual samples.