Guest User

Untitled

a guest
Jun 17th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. from keras.utils import np_utils
  2.  
  3. # Transofrm them to a float32 type
  4. x_train = x_train.astype('float32')
  5. x_test = x_test.astype('float32')
  6.  
  7. # Normalize the input
  8. x_train /= 255
  9. x_test /= 255
  10.  
  11. # One-hot Encoding
  12. num_classes = 10
  13. y_train = np_utils.to_categorical(y_train, num_classes)
  14. y_test = np_utils.to_categorical(y_test, num_classes)
Add Comment
Please, Sign In to add comment