MixUp
类keras_cv.layers.MixUp(alpha=0.2, seed=None, **kwargs)
MixUp 实现 MixUp 数据增强技术。
参数
参考文献
示例
(images, labels), _ = keras.datasets.cifar10.load_data()
images, labels = images[:10], labels[:10]
# Labels must be floating-point and one-hot encoded
labels = tf.cast(tf.one_hot(labels, 10), tf.float32)
mixup = keras_cv.layers.preprocessing.MixUp(10)
augmented_images, updated_labels = mixup(
{'images': images, 'labels': labels}
)
# output == {'images': updated_images, 'labels': updated_labels}