interval_mask
PythonSample one interval per example; returned mask broadcasts over channels.
interval_mask(layer, shape, axis, minimum, maximum)Sample one interval per example; returned mask broadcasts over channels.
Signal-only occlusion with explicit half-open intervals and owned RNG.
interval_maskfunctionSample one interval per example; returned mask broadcasts over channels.RandomCutout1DclassReplace random temporal intervals in each example during training.RandomCutout2DclassReplace random rectangular regions in each example during training.Sample one interval per example; returned mask broadcasts over channels.
interval_mask(layer, shape, axis, minimum, maximum)Sample one interval per example; returned mask broadcasts over channels.
Replace random temporal intervals in each example during training.
RandomCutout1D(factor=0.1, cutouts=1, fill_mode='constant', fill_value=0.0, **kwargs={})Replace random temporal intervals in each example during training.
Regions share their positions across channels. Targets and masks remain unchanged; only signal values are occluded. Overlapping regions are allowed.
Base class: BaseAugmentation1D.
Inherited from BaseAugmentation: augment_masks(), augment_sample(), augment_targets(), batch_augment(), call().
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
factor | float | tuple[float, float] | 0.1 | Fractional size bounds in [0, 1] for each spatial axis. A scalar sets the upper bound with a zero lower bound; a pair sets both bounds. |
cutouts | int | 1 | Nonnegative number of regions sampled per example. |
fill_mode | str | 'constant' | "constant" for a fixed value or "normal" for Gaussian noise. |
fill_value | float | 0.0 | Constant fill value, or the nonnegative standard deviation of zero-mean Gaussian noise when fill_mode is "normal". |
**kwargs | Any | {} | Base augmentation options, including seed and data_format. |
Raises
| Type | Description |
|---|---|
ValueError | Size bounds, region count, fill mode or noise deviation violate these constraints. |
get_random_transformations(input_shape)augment_samples(inputs)get_config()Replace random rectangular regions in each example during training.
RandomCutout2D(factor=0.1, cutouts=1, fill_mode='constant', fill_value=0.0, **kwargs={})Replace random rectangular regions in each example during training.
Regions share their positions across channels. Targets and masks remain unchanged; only signal values are occluded. Overlapping regions are allowed.
Base class: BaseAugmentation2D.
Inherited from BaseAugmentation: augment_masks(), augment_sample(), augment_targets(), batch_augment(), call().
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
factor | float | tuple[float, float] | 0.1 | Fractional size bounds in [0, 1] for each spatial axis. A scalar sets the upper bound with a zero lower bound; a pair sets both bounds. |
cutouts | int | 1 | Nonnegative number of regions sampled per example. |
fill_mode | str | 'constant' | "constant" for a fixed value or "normal" for Gaussian noise. |
fill_value | float | 0.0 | Constant fill value, or the nonnegative standard deviation of zero-mean Gaussian noise when fill_mode is "normal". |
**kwargs | Any | {} | Base augmentation options, including seed and data_format. |
Raises
| Type | Description |
|---|---|
ValueError | Size bounds, region count, fill mode or noise deviation violate these constraints. |
get_random_transformations(input_shape)augment_samples(inputs)get_config()