Skip to content

Commit 3c0fe91

Browse files
author
(Ian Stenbit)
committed
Add a test coverage on label smoothing summations
1 parent d9ed09c commit 3c0fe91

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

keras_cv/layers/preprocessing/cut_mix_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def test_label_smoothing(self):
4444
layer = CutMix(1.0, label_smoothing=0.2, seed=1)
4545
xs, ys = layer(xs, ys)
4646
self.assertNotAllClose(ys, 0.0)
47+
self.assertAllClose(tf.math.reduce_sum(ys, axis=-1), (1.0, 1.0))
4748

4849
def test_cut_mix_call_results(self):
4950
xs = tf.cast(

keras_cv/layers/preprocessing/mix_up_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def test_label_smoothing(self):
4444
layer = MixUp(1.0, label_smoothing=0.2)
4545
xs, ys = layer(xs, ys)
4646
self.assertNotAllClose(ys, 0.0)
47+
self.assertAllClose(tf.math.reduce_sum(ys, axis=-1), (1.0, 1.0))
4748

4849
def test_mix_up_call_results(self):
4950
xs = tf.cast(

0 commit comments

Comments
 (0)