Reputation: 717
When using ImageDataGenerator
in Keras, should I rescale the images?
why to use rescale
?
train_datagen = ImageDataGenerator(
rescale=1./255,
shear_range=0.2,
zoom_range=0.2,
horizontal_flip=True)
Upvotes: 0
Views: 284
Reputation: 3580
This is usually done for practical considerations. Standardizing input to lie within [0, 1]
range helps gradient descent based optimizations to converge faster i.e., it speeds up the training. It can also sometimes help you find better local optima i.e., improve model performance.
Upvotes: 2