From 092d01aa766f2f7fd7e9bbceaf71cff29188b328 Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Mon, 18 Jan 2021 12:28:11 -0500 Subject: In-lined score reporting --- src/train5.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/train5.py b/src/train5.py index 2fc0d6f..3683c1e 100644 --- a/src/train5.py +++ b/src/train5.py @@ -100,6 +100,9 @@ def train(size, model, data, iterations=1, epochs=10): t_loss, t_accuracy = model.evaluate(training_input, training_outcome, verbose=False, batch_size=32) results += [((v_loss, t_loss), (v_accuracy, t_accuracy))] + print("\nScores") + for i in range(len(results)): + print("Iteration {0}: {1}".format(i+1, results[i])) return results @@ -163,10 +166,6 @@ def write_weights(model): data = load_data(5) model = make_model(5, [12, 11, 8]) results = train(5, model, data, iterations=5, epochs=10) -print("\nScores") -for i in range(len(results)): - print("Iteration {0}: {1}".format(i+1, results[i])) - write_weights(model) # results = magic_search(data) -- cgit v1.2.3