Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. # normalize data
  2. x_train = x_train.astype('float32') / 255.
  3. x_val = x_val.astype('float32') / 255.
  4. x_test = x_test.astype('float32') / 255.
  5.  
  6. # convert labels to one-hot vectors
  7. y_train = keras.utils.to_categorical(y_train, num_classes)
  8. y_val = keras.utils.to_categorical(y_val, num_classes)
  9. y_test = keras.utils.to_categorical(y_test, num_classes)
  10. print(y_test.shape)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement