Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. from keras import backend as K
  2. if K.image_data_format() == 'channels_first' :
  3. input_shape = (1, 28, 28)
  4. X_train = X_train.reshape(X_train.shape[0], 1, 28, 28)
  5. X_test = X_test.reshape(X_test.shape[0], 1, 28, 28)
  6. else:
  7. input_shape = (28, 28, 1)
  8. X_train = X_train.reshape(X_train.shape[0], 28, 28, 1)
  9. X_test = X_test.reshape(X_test.shape[0], 28, 28, 1)
  10.  
  11. model.add(Input((28 * 28,)))
  12.  
  13. images_array = images_array.reshape(-1, 28 * 28)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement