<jupyter_start><jupyter_text>NOT-MNIST  http://yaroslavvb.blogspot.in/2011/09/notmnist-dataset.html  (data)<jupyter_code>import numpy as np
import pandas as pd
from keras.models import Sequential,Model
from keras.layers import Dropout ,Activation,AveragePooling2D, normalization,Convolution2D,MaxPooling2D
from keras.layers import Dense, Flatten, Reshape, Input
from keras.utils import np_utils
from matplotlib import pyplot as plt
%matplotlib inline
X_train = np.load('X_NOTMN.npy')
Y_train = np.load('Y_NOTMN.npy')
X_train = X_train/255.0
Y_train = np_utils.to_categorical(Y_train)
print X_train.shape, Y_train.shape
for ix in range(10):
    plt.figure(ix)
    plt.imshow(X_train[ix], interpolation='none', cmap='gray')
plt.show()
X_train = X_train.reshape((X_train.shape[0],28,28,1))

inp = Input(shape=(28,28,1))
x1 = Convolution2D( 32,(5,5))(inp)

r1_a1 = Activation('relu')(x1)
r1_w1 = Convolution2D(32,( 5,5))(r1_a1)
r1_a2 = Activation('relu')(r1_w1)
r1_d1 = Dropout(0.2)(r1_a2)
r1_w2 = Convolution2D(32,( 5,5))(r1_d1)

x2 = Convolution2D(8,( 5,5))(r1_w2)
acti = Activation('relu')(x2)
av_pool = MaxPooling2D((2,2))((acti))
f1 = Flatten()(av_pool)
fc1 = Dense(32)(f1)
a1 = Activation('relu')(fc1)
fc3 = Dense(10)(a1)
a3 = Activation('softmax')(fc3)

model = Model(outputs=a3, inputs=inp)
model.summary()
model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
hist = model.fit(X_train,Y_train,
                 epochs=25,
                 shuffle=True,
                 batch_size=256,
                 validation_split=0.20)
plt.plot(hist.history['acc'],'g')
plt.plot(hist.history['val_acc'],'b')
plt.plot(hist.history['loss'],'r')
plt.plot(hist.history['val_loss'],'black')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16523235800344235, 'fraction_numerical': 0.055077452667814115, 'mean_word_length': 5.785992217898833, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '27625', 'license': 'MIT', 'n_tokens_mistral': 763, 'n_tokens_neox': 720, 'n_words': 112, 'path': 'NOT-MNIST-NN.ipynb', 'repo_name': 'vasu-dev/SC-Project', 'size': '1743'}