I’d like to edit the function used to generate random values in RandomErasing. Currently, values are generated with torch.normal_():
v = torch.empty([img_c, h, w], dtype=torch.float32).normal_()
This function sometimes generates values outside of [0, 1). Due to experimental constraints my network input needs to be scaled to this range.
Using this implementation to min-max normalize the output of RandomErasing, unfortunately, results in pixel artifacts. Trying the min-max normalization on the individual channels results in greyed images. (See respective images below.)
I would like RandomErasing to only generate uniform [0,1) random values. I believe the implementation I need would look like this:
v = torch.rand((img_c, h, w), dtype=torch.float64)
I don’t believe it is possible to fork Pytorch source code and edit it.
How else could I edit a built-in transform?
Alternatively, is there something I’m not seeing regarding the min-max normalization?
(@developers FYI: I believe the default RandomErasing scale values are incorrect. According to the paper the optimal values are: scale=(0.02, 0.4).)