new_contents: from keras.datasets import cifar10
  from keras.models import Sequential
  from keras.layers import Dense, Dropout, Activation, Flatten
  from keras.utils import np_utils
  
  
  if __name__ == '__main__':
      nb_epoch = 50
      batch_size = 128
      nb_classes = 10
  
      (X_train, y_train), (X_test, y_test) = cifar10.load_data()
  
      X_train = X_train.reshape(50000, 32 * 32 * 3)
      X_test = X_test.reshape(10000, 32 * 32 * 3)
  
      X_train = X_train.astype('float32')
      X_test = X_test.astype('float32')
      X_train /= 255.0
      X_test /= 255.0
  
      Y_train = np_utils.to_categorical(y_train, nb_classes)
      Y_test = np_utils.to_categorical(y_test, nb_classes)
  
      # MLP
      model = Sequential()
      model.add(Dense(1024, input_shape=(3072, )))
      model.add(Activation('relu'))
      model.add(Dropout(0.2))
      model.add(Dense(512))
      model.add(Activation('relu'))
      model.add(Dropout(0.2))
      model.add(Dense(512))
      model.add(Activation('relu'))
      model.add(Dropout(0.2))
      model.add(Dense(10))
      model.add(Activation('softmax'))
  
      model.compile(loss='categorical_crossentropy',
                    optimizer='adam',
                    metrics=['accuracy'])
      model.summary()
  
      # training
      model.fit(X_train, Y_train,
                batch_size=batch_size,
                nb_epoch=nb_epoch,
                verbose=1,
                validation_data=(X_test, Y_test))
  
      loss, acc = model.evaluate(X_test, Y_test, verbose=0)
      print('Test loss:', loss)
      print('Test acc:', acc)
  
subject: Add cifar10.py on mlp