tensorflow 重新缩放:偏移比例

o4tp2gmn  于 2022-11-16  发布在  其他
关注(0)|答案(1)|浏览(126)

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.

whlutmcx

whlutmcx1#

通过scale*inputs+offset进行重新缩放。
在这种情况下为

[0,255] range it would give 4*[0, 255]+1 : [1, 1021]

相关问题