SIGN IN SIGN UP
tensorflow / models UNCLAIMED

Models and examples built with TensorFlow

0 0 0 Python

Update beta sampling code in augment.py

The function `_sample_from_beta(alpha, beta, shape)` in `MixupAndCutmix` class, is not having the same functionality as `numpy.random.beta`. So `tfm.vision.augment.MixupAndCutmix._sample_from_beta(0.2, 0.2, tf.shape( tf.range(10000))).numpy()` is also deviating as well. So suggesting the fix keeping `alpha=alpha, beta=1.0` in  `_sample_from_beta`. The reproduced [gist](https://colab.sandbox.google.com/gist/LakshmiKalaKadali/06533824610d6e85ea4aa3c6399819e6/tf_model_13490.ipynb#scrollTo=zSlE-3YDjL91) also attached. 

This PR closes [#13490](https://github.com/tensorflow/models/issues/13490)

Thank You
L
LakshmiKalaKadali committed
bdbcbaa89ff0a4a807c3cfb72f5f9842fc611e34
Parent: 3d5e05f
Committed by GitHub <noreply@github.com> on 1/30/2025, 5:16:43 PM