Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

in order to do pattern matching properly convolutions require normalization https://en.wikipedia.org/wiki/Cross-correlation#Normalized_cross-correlation

unfortunately I can't find a way how to make input normalization for conv2d function.

is it hidden in implementation?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
175 views
Welcome To Ask or Share your Answers For Others

1 Answer

If I'm not mis-reading that, it's in the image library in TF 1.x:

tf.image.per_image_standardization

https://www.tensorflow.org/api_guides/python/image

By the way, that particular function is a little annoying in that it only takes a single image as an input (3D), but you usually have a 4D tensor representing [batch, height, width, channels] for images. To apply that function to a batch of images you can do this:

imgs4d = tf.map_fn(tf.image.per_image_standardization, imgs4d_float32)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...