Cutmix

class easypl.callbacks.mixers.cutmix.Cutmix(on_batch: bool = True, alpha: float = 0.4, num_workers: int = 1, p: float = 0.5, domen: str = 'classification')

Callback for cutmixing data operations

on_batch

If True generate samples from batch otherwise from dataset.

Type

bool

p

Mix probability.

Type

float

num_workers

Number of workers for mixing operation.

Type

int

alpha

Parameter of cutmix operation.

Type

float

domen

Name of task, in which will be mixed samples. Available: [“classification, segmentation”].

Type

str

mix(sample1: Dict, sample2: Dict) Dict

Cutmix method for two samples.

sample1

Sample of batch, which will be sampled with sample from sample2.

Type

Dict

sample2

Sample from batch or dataset.

Type

Dict

Returns

Mixed sample.

Return type

Dict