Noran
Noran

Reputation: 717

Why to rescale images in deep learning?

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

Answers (1)

xashru
xashru

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

Related Questions