aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornunzip <np.scarh@gmail.com>2018-11-07 17:43:42 +0000
committernunzip <np.scarh@gmail.com>2018-11-07 17:43:42 +0000
commit1e23bbe1fdb9f4da13bb8bbcd67430b8334e271f (patch)
tree43554453f842e72abb683fcbad853fe152dd6cdb
parent1fd0f01cb200672c26dc4f018e8aa6c12f08a7ac (diff)
downloadvz215_np1915-1e23bbe1fdb9f4da13bb8bbcd67430b8334e271f.tar.gz
vz215_np1915-1e23bbe1fdb9f4da13bb8bbcd67430b8334e271f.tar.bz2
vz215_np1915-1e23bbe1fdb9f4da13bb8bbcd67430b8334e271f.zip
Fix reigen. Range was wrong
-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 (%)')