Class CutMixBatch

Inheritance Relationships

Base Type

Class Documentation

class CutMixBatch : public mindspore::dataset::TensorTransform

Mask a random section of each image with the corresponding part of another randomly selected image in that batch.

Public Functions

explicit CutMixBatch(ImageBatchFormat image_batch_format, float alpha = 1.0, float prob = 1.0)

Constructor.

Parameters
  • image_batch_format[in] The format of the batch.

  • alpha[in] The hyperparameter of beta distribution (default = 1.0).

  • prob[in] The probability by which CutMix is applied to each image (default = 1.0).

样例
/* dataset is an instance of Dataset object */
dataset = dataset->Batch(5);
dataset = dataset->Map({std::make_shared<vision::CutMixBatch>(ImageBatchFormat::kNHWC)}, // operations
                       {"image", "label"});                                             // input columns
~CutMixBatch() = default

Destructor.