aboutsummaryrefslogtreecommitdiff
path: root/lenet.py
diff options
context:
space:
mode:
authornunzip <np.scarh@gmail.com>2019-03-07 01:44:07 +0000
committernunzip <np.scarh@gmail.com>2019-03-07 01:44:07 +0000
commit36629817fbdcc9e696e27f371ca2905ba6cb99aa (patch)
treeab4d9b16e3df47dcba680f519bbdf49e10db8049 /lenet.py
parentb878862fbf449178fe314d31c03c615433c17f5d (diff)
downloade4-gan-36629817fbdcc9e696e27f371ca2905ba6cb99aa.tar.gz
e4-gan-36629817fbdcc9e696e27f371ca2905ba6cb99aa.tar.bz2
e4-gan-36629817fbdcc9e696e27f371ca2905ba6cb99aa.zip
Pass verbose classifier as a flag
Diffstat (limited to 'lenet.py')
-rw-r--r--lenet.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lenet.py b/lenet.py
index 71b1c9e..4950fe9 100644
--- a/lenet.py
+++ b/lenet.py
@@ -118,7 +118,7 @@ def plot_history(history, metric = None):
plt.ylabel('Loss')
plt.xlabel('Epoch')
-def train_classifier(x_train, y_train, x_val, y_val, batch_size=128, epochs=100, metrics=[categorical_accuracy], optimizer = None, keep_training = False):
+def train_classifier(x_train, y_train, x_val, y_val, batch_size=128, epochs=100, metrics=[categorical_accuracy], optimizer = None, keep_training = False, verbose=1):
shape = (32, 32, 1)
# Pad data to 32x32 (MNIST is 28x28)
@@ -133,7 +133,7 @@ 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)
if keep_training:
model.load_weights('./weights.h5')
- history = model.fit(x_train, y_train, batch_size=batch_size, epochs=epochs, verbose=1, validation_data = (x_val, y_val))
+ history = model.fit(x_train, y_train, batch_size=batch_size, epochs=epochs, verbose=verbose, validation_data = (x_val, y_val))
model.save_weights('./model_gan.h5')
plot_history(history, 'categorical_accuracy')
plot_history(history)