Skip to content

Commit

Permalink
reorganized solutions according to corresponding notebook number
Browse files Browse the repository at this point in the history
  • Loading branch information
leriomaggio committed Apr 12, 2017
1 parent 8a96b5a commit 7443f1c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
File renamed without changes.
16 changes: 16 additions & 0 deletions solutions/sol_221_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from keras.callbacks import EarlyStopping

early_stop = EarlyStopping(monitor='val_loss', patience=4, verbose=1)

model = Sequential()
model.add(Dense(512, activation='relu', input_shape=(784,)))
model.add(Dropout(0.2))
model.add(Dense(512, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(10, activation='softmax'))

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

model.fit(X_train, Y_train, validation_data = (X_test, Y_test), epochs=100,
batch_size=128, verbose=True, callbacks=[early_stop])
File renamed without changes.

0 comments on commit 7443f1c

Please sign in to comment.