skip
optimus_dl.modules.data.transforms.skip
¶
SkipInterleavedTransform
¶
Bases: BaseTransform
Transform that deterministically skips a fixed number of data items.
This is useful for downsampling a dataset or creating interleaved subsets.
It guarantees that the first item is always produced, followed by skipping
exactly skip_count items before producing the next one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg
|
SkipInterleavedTransformConfig
|
Configuration containing the |
required |
Source code in optimus_dl/modules/data/transforms/skip.py
build(source)
¶
SkipInterleavedTransformConfig
dataclass
¶
Bases: RegistryConfigStrict
Configuration for skip_interleaved.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skip_count
|
int
|
|
1
|
Source code in optimus_dl/modules/data/transforms/skip.py
SkipRandomTransform
¶
Bases: BaseTransform
Transform that randomly skips data items.
This adds stochastic sub-sampling to the data pipeline. Note that since skipping is probabilistic, the final dataset length will vary slightly unless exactly replicated with the same random seed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg
|
SkipRandomTransformConfig
|
Configuration with the skip probability. |
required |
Source code in optimus_dl/modules/data/transforms/skip.py
build(source)
¶
SkipRandomTransformConfig
dataclass
¶
Bases: RegistryConfigStrict
Configuration for skip_random.
Attributes:
| Name | Type | Description |
|---|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
probability
|
float
|
|
0.5
|