aboutsummaryrefslogtreecommitdiff
path: root/lenet.py
diff options
context:
space:
mode:
authornunzip <np.scarh@gmail.com>2019-03-06 20:41:43 +0000
committernunzip <np.scarh@gmail.com>2019-03-06 20:41:43 +0000
commitc626433a54bead146083596d08c2ed05c2aed5ee (patch)
treeeb14f5d5ca3b6c7ac84730491ab13fd74697a252 /lenet.py
parentf2d09edb7fb511364347ae9df1915a6655f45a0a (diff)
parent8842630c10bc302c5961ed7a763fcbd6282449cb (diff)
downloade4-gan-c626433a54bead146083596d08c2ed05c2aed5ee.tar.gz
e4-gan-c626433a54bead146083596d08c2ed05c2aed5ee.tar.bz2
e4-gan-c626433a54bead146083596d08c2ed05c2aed5ee.zip
Merge branch 'new_branch'
Diffstat (limited to 'lenet.py')
-rw-r--r--lenet.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/lenet.py b/lenet.py
index 663c137..3ddab06 100644
--- a/lenet.py
+++ b/lenet.py
@@ -114,14 +114,13 @@ def train_classifier(x_train, y_train, x_val, y_val, batch_size=128, epochs=100,
optimizer = optimizers.SGD(lr=0.001, decay=1e-6, momentum=0.9, nesterov=True)
model.compile(loss='categorical_crossentropy', metrics=metrics, optimizer=optimizer)
-
if keep_training:
- model.load_weights('./model_gan.h5', by_name=False)
-
+ 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))
model.save_weights('./model_gan.h5')
plot_history(history, 'categorical_accuracy')
plot_history(history)
+ model.save_weights('./weights.h5')
return model
def test_classifier(model, x_test, y_true):