To rescale an input in the [0, 255] range to be in the [0, 1] range, you would pass scale=1./255.
To rescale an input in the [0, 255] range to be in the [-1, 1] range, you would pass scale=1./127.5, offset=-1.
I understood the above example.
but, I can't understand this code
tf.keras.layers.Rescaling(scale=4.0, offset=1.0)
As above, if I pass the scale and offset values as above, I wonder what the range of the input value will be, and I'm curious about the meaning of scale and offset.
1条答案
按热度按时间whlutmcx1#
通过
scale*inputs+offset
进行重新缩放。在这种情况下为