diff options
-rwxr-xr-x | train.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -64,6 +64,7 @@ parser.add_argument("-2", "--grapheigen", help="Swow 2D graph of targets versus parser.add_argument("-p", "--pca", help="Use PCA", action='store_true') parser.add_argument("-l", "--lda", help="Use LDA", action='store_true') parser.add_argument("-r", "--reconstruct", help="Use PCA reconstruction, specify face NR", type=int, default=0) + parser.add_argument("-q", "--pca_r", help="Use Reduced PCA", action='store_true') args = parser.parse_args() @@ -85,7 +86,7 @@ sc = StandardScaler() explained_variances = () -if args.pca or (args.pca and args.lda) or args.pca_r: +if args.pca or args.pca_r: # faces_pca containcts the principial components or the M most variant eigenvectors average_face = np.mean(faces_train, axis=0) faces_train = normalise_faces(average_face, faces_train) @@ -94,6 +95,7 @@ if args.pca or (args.pca and args.lda) or args.pca_r: e_vals, e_vecs = LA.eigh(np.cov(faces_train)) e_vecs_original = e_vecs e_vecs = np.dot(faces_train.T, e_vecs) + # e_vecs = normalise_faces(np.mean(e_vecs,axis=0), e_vecs) e_vecs = sc.fit_transform(e_vecs) ###TODO Maybe replace with our normalising function |