mixup_batch
MixUpBatch
¶
Bases: TensorOp
MixUp augmentation for tensors.
This class helps to reduce over-fitting, stabilize GAN training, and against adversarial attacks (https://arxiv.org/abs/1710.09412).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inputs |
Iterable[str]
|
Keys of the image batch and label batch to be mixed up. |
required |
outputs |
Iterable[str]
|
Keys under which to store the mixed up images and mixed up label. |
required |
mode |
Union[None, str, Iterable[str]]
|
What mode to execute in. Probably 'train'. |
'train'
|
ds_id |
Union[None, str, Iterable[str]]
|
What dataset id(s) to execute this Op in. To execute regardless of ds_id, pass None. To execute in all ds_ids except for a particular one, you can pass an argument like "!ds1". |
None
|
alpha |
float
|
The alpha value defining the beta distribution to be drawn from during training. |
1.0
|
shared_beta |
bool
|
Sample a single beta for a batch or element wise beta for each image. |
False
|
Raises:
Type | Description |
---|---|
AssertionError
|
If input arguments are invalid. |