Description
System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): All
- TensorFlow version and how it was installed (source or binary): 0.12.1 from source
- TensorFlow-Addons version and how it was installed (source or binary): 2.4.1 from source
- Python version: 3.8
- Is GPU used? (yes/no): yes
Describe the bug
The current implementation of 'tfa.image.random_cutout' is wrong. According to the paper Improved Regularization of Convolutional Neural Networks with Cutout, the optimal random centers of the mask patches should be uniformly sampled from the whole image, which means that the path should sometimes overlap with the image borders and be partially excluded from the image. In other words, the center x and y should be sampled from [0, length] for height and width respectively, but the current implementation is sampling from [half_size, image_length - half_size].
The current implementation is contradicted with the paper and the implementation of previous tfa versions. In practice, the current implementation also leads to decreased accuracy.
Please change the sampling back to [0, length].