October 2018
Intermediate to advanced
472 pages
10h 57m
English
Set the type to np.float32.
For centering, we subtract the dataset by 127.5. The values in the dataset will now range between -127.5 to 127.5.
For scaling, we divide the centered dataset by half of the maximum pixel value in the dataset, that is, 255/2. This will result in a dataset with values ranging between -1 and 1:
# Converting integer values to float types X_train = X_train.astype(np.float32)X_test = X_test.astype(np.float32)# Scaling and centering ...
Read now
Unlock full access