Browse files

Fixed bug in Fisherfaces due to refactoring.

  • Loading branch information...
1 parent 5fd29d9 commit 1e59fd2a91920d6e9bfdd01821a250e7daf0bc9a @bytefish committed Mar 7, 2013
Showing with 5 additions and 5 deletions.
  1. +2 −2 m/models/fisherfaces.m
  2. +3 −3 m/models/lda.m
View
4 m/models/fisherfaces.m
@@ -21,14 +21,14 @@
c = max(y);
% set the num_components
- if(nargin==2)
+ if(nargin < 3)
num_components=c-1;
end
num_components = min(c-1, num_components);
% reduce dim(X) to (N-c) (see paper [BHK1997])
- Pca = pca(X, y, (N-c));
+ Pca = pca(X, (N-c));
Lda = lda(project(X, Pca.W, Pca.mu), y, num_components);
% build model
View
6 m/models/lda.m
@@ -21,7 +21,7 @@
c = max(y);
if(nargin < 3)
- num_components = c - 1
+ num_components = c - 1;
end
num_components = min(c-1,num_components);
@@ -45,9 +45,9 @@
[V, D] = eig(Sb,Sw);
% sort eigenvectors descending by eigenvalue
- [D,idx] = sort(diag(D),1,'descend');
- V = V(:,idx);
+ [D,idx] = sort(diag(D), 1, 'descend');
+ V = V(:,idx);
% build model
model.name = 'lda';
model.num_components = num_components;

0 comments on commit 1e59fd2

Please sign in to comment.