Menu

Data Preprocessing

Data Preprocessing

Normalize the pixel values before training.

Code

X_train = X_train / 255.0
X_test = X_test / 255.0

Explanation

Image pixel values range from 0 to 255. Dividing by 255 scales the values between 0 and 1, making the training process more efficient.