From 1b8df12ee7cfac206d74d28abd0ac4bf0957c7a1 Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Mon, 29 Oct 2018 15:58:14 +0000 Subject: Simplify condition --- train.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/train.py b/train.py index 3b2b364..0b0ce0e 100755 --- a/train.py +++ b/train.py @@ -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 -- cgit v1.2.3-54-g00ecf