text_plain_output_1.png
from keras.layers import Conv2D, MaxPooling2D

from keras.layers import Dense, Dropout, Flatten

from keras.models import Sequential

from keras.utils import to_categorical

from sklearn.model_selection import train_test_split

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

fashion_train = pd.read_csv('../input/fashion-mnist_train.csv')
fashion_test = pd.read_csv('../input/fashion-mnist_test.csv')

from keras.utils import to_categorical
from sklearn.model_selection import train_test_split
img_rows, img_cols = (28, 28)
input_shape = (img_rows, img_cols, 1)
X = fashion_train.drop(['label'], axis=1).values
y = to_categorical(fashion_train['label'].values)
X_train, X_val, y_train, y_val = train_test_split(X, y, test_size=0.2, random_state=42)
X_test = fashion_test.drop(['label'], axis=1).values
y_test = to_categorical(fashion_test['label'].values)

from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras.layers.normalization import BatchNormalization
batch_size = 256
num_classes = 10
epochs = 50
img_rows, img_cols = (28, 28)
model = Sequential()
model.add(Conv2D(32, kernel_size=(3, 3), activation='relu', kernel_initializer='he_normal', input_shape=input_shape))
model.add(MaxPooling2D((2, 2)))
model.add(Dropout(0.25))
model.add(Conv2D(64, (3, 3), activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.25))
model.add(Conv2D(128, (3, 3), activation='relu'))
model.add(Dropout(0.4))
model.add(Flatten())
model.add(Dense(128, activation='relu'))
model.add(Dropout(0.3))
model.add(Dense(num_classes, activation='softmax'))

model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])

model.summary()