print(model.summary()) # %% history = model.fit( np.array(X_train), np.array(y_train), batch_size = 100, epochs = 50, verbose=2, validation_data = (X_test, y_test), ) # %% [markdown] # ### CNN Predict # %% score = model.evaluate(X_test, y_test, verbose = 0) print('Test loss:', score[0]) print('Test accuracy:', score[1]) pred = model.predict(X_test) pred = np.argmax(pred, axis = 1) label = (y_test) print(pred) print(label) # %% [markdown] # ## Color Clustering with K-Means # ### Image compression using K-Means can be easy.