aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtrain.py5
1 files 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 (%)')