import pickle
model = keras.Sequential([
keras.layers.Dense(SHAPE, input_shape=(SHAPE,)),
keras.layers.Dense(300, activation='sigmoid'),
keras.layers.Dense(10, activation='softmax')
])
#****************** COMPILING THE MODE *****************
LEARNING_RATE = 0.0005
model.compile(optimizer=keras.optimizers.Adam(lr=LEARNING_RATE),
loss='sparse_categorical_crossentropy',
metrics=['accuracy']
)
# *********** TRAINING THE MODEL **********
EPOCHS = 20
BATCH_SIZE=50
history_original_data = model.fit(X_original_train_images, y_original_train_labels, epochs=EPOCHS, batch_size=BATCH_SIZE)
hist_original=history_original_data.history
### PICKLE TO SAVE THE MODEL TO BE USED WITHOU PRO-TRAINING IT
pickname ="SequentialNeuroNetwork.pkl"
PickleSeq = open(pickname, 'wb')
pickle.dump(model, PickleSeq)
PickleSeq.close()