diff options
-rwxr-xr-x | train.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 (%)') |