Skip to content

Commit

Permalink
fixed mixBernRnd. nbBern is done. nbBernPred and mixBernEm are not done
Browse files Browse the repository at this point in the history
  • Loading branch information
sth4nth committed Mar 7, 2016
1 parent 30740bf commit 70f6234
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chapter08/nbBern.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
% Output:
% model: trained model structure
% Written by Mo Chen ([email protected]).
n = size(X,2);
k = max(t);
n = size(X,2);
E = sparse(t,1:n,1,k,n,n);
nk = full(sum(E,2));
w = nk/n;
Expand Down
2 changes: 1 addition & 1 deletion chapter09/mixBernRnd.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
X = zeros(d,n);
for i = 1:k
idx = z==i;
X(:,idx) = bsxfun(@le,rand(d,sum(idx)), mu(:,k));
X(:,idx) = bsxfun(@le,rand(d,sum(idx)), mu(:,i));
end

0 comments on commit 70f6234

Please sign in to comment.