aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornunzip <np.scarh@gmail.com>2019-02-28 00:01:09 +0000
committernunzip <np.scarh@gmail.com>2019-02-28 00:01:09 +0000
commitcbb551537a2505d8f189a4faf9e8c67fe1753d47 (patch)
treec70d96aac759190745494a23df8e3a4de9e0fff7
parent48a6fa973b65a696d087af35c1b410d73ecddde4 (diff)
downloade4-gan-cbb551537a2505d8f189a4faf9e8c67fe1753d47.tar.gz
e4-gan-cbb551537a2505d8f189a4faf9e8c67fe1753d47.tar.bz2
e4-gan-cbb551537a2505d8f189a4faf9e8c67fe1753d47.zip
Graph both loss and accuracy
-rw-r--r--lenet.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lenet.py b/lenet.py
index 2372857..31664ee 100644
--- a/lenet.py
+++ b/lenet.py
@@ -116,7 +116,8 @@ def train_classifier(x_train, y_train, x_val, y_val, batch_size=128, epochs=100,
model.compile(loss='categorical_crossentropy', metrics=metrics, optimizer=optimizer)
history = model.fit(x_train, y_train, batch_size=batch_size, epochs=epochs, verbose=1, validation_data = (x_val, y_val))
- plot_history(history, metrics)
+ plot_history(history, 'categorical_accuracy')
+ plot_history(history)
return model
def test_classifier(model, x_test, y_true):
@@ -157,5 +158,5 @@ def mix_data(X_train, y_train, X_validation, y_validation, train_gen, tr_labels_
if __name__ == '__main__':
x_train, y_train, x_val, y_val, x_t, y_t = import_mnist()
print(y_t.shape)
- model = train_classifier(x_train[:100], y_train[:100], x_val, y_val, epochs=1)
+ model = train_classifier(x_train[:100], y_train[:100], x_val, y_val, epochs=3)
test_classifier(model, x_t, y_t)