From 1e23bbe1fdb9f4da13bb8bbcd67430b8334e271f Mon Sep 17 00:00:00 2001 From: nunzip Date: Wed, 7 Nov 2018 17:43:42 +0000 Subject: Fix reigen. Range was wrong --- train.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/train.py b/train.py index 169163f..7f5b574 100755 --- a/train.py +++ b/train.py @@ -239,8 +239,8 @@ def main(): return if args.reigen: - accuracy = np.zeros(n_faces) - rec_error = np.zeros(n_faces) + accuracy = np.zeros(args.reigen-args.eigen) + rec_error = np.zeros((args.reigen-args.eigen, 2*n_faces)) for M in range(args.eigen, args.reigen): start = timer() accuracy[M - args.eigen], rec_error[M - args.eigen] = test_model(M, faces_train, faces_test, target_train, target_test, args) @@ -248,6 +248,7 @@ def main(): print("Run with", M, "eigenvalues completed in ", end-start, "seconds") print("Memory Used:", psutil.Process(os.getpid()).memory_info().rss) #plot + print('Max efficiency of ', max(accuracy), '% for M =', np.argmax(accuracy)) plt.plot(range(args.eigen, args.reigen), 100*accuracy) plt.xlabel('Number of Eigenvectors used (M)') plt.ylabel('Recognition Accuracy (%)') -- cgit v1.2.3-54-g00ecf