MixUp
類別keras.layers.MixUp(alpha=0.2, data_format=None, seed=None, **kwargs)
MixUp 實作 MixUp 資料擴增技術。
引數
參考文獻
範例
(images, labels), _ = keras.datasets.cifar10.load_data()
images, labels = images[:8], labels[:8]
labels = keras.ops.cast(keras.ops.one_hot(labels.flatten(), 10), "float32")
mix_up = keras.layers.MixUp(alpha=0.2)
output = mix_up({"images": images, "labels": labels})