Created
July 23, 2020 03:34
-
-
Save girija2204/4d3f33a887c9e1a55a6d543f27fd81c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def normalize(image,label): | |
return tf.cast(image,tf.float32)/255.0, label | |
x, y = normalize([243,225,297],2) | |
x.numpy(), y | |
# (array([0.9529412 , 0.88235295, 1.1647059 ], dtype=float32), 2) | |
train_tensor_slices = train_tensor_slices.map(normalize).batch(128) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment