diff --git a/common/gsog.m b/common/gsog.m index 037c2fc..3a2b5b5 100644 --- a/common/gsog.m +++ b/common/gsog.m @@ -1,5 +1,6 @@ function [Q, R] = gsog(X) % Gram-Schmidt orthogonalization +% Written by Mo Chen (sth4nth@gmail.com). [d,n] = size(X); m = min(d,n); R = eye(m,n); diff --git a/common/gson.m b/common/gson.m index 8ff6683..1fcdda4 100644 --- a/common/gson.m +++ b/common/gson.m @@ -1,5 +1,6 @@ function [Q, R] = gson(X) % Gram-Schmidt orthonormalization which produces the same result as [Q,R]=qr(X,0) +% Written by Mo Chen (sth4nth@gmail.com). [d,n] = size(X); m = min(d,n); R = zeros(m,n); diff --git a/common/invpd.m b/common/invpd.m index c8ab2dd..572666c 100644 --- a/common/invpd.m +++ b/common/invpd.m @@ -1,6 +1,7 @@ function W = invpd(M) % Compute A\B where A is a positive definite matrix -% A: a positive difinie matrix +% Input: +% M: a positive difinie matrix % Written by Michael Chen (sth4nth@gmail.com). [U,p] = chol(M); if p > 0 diff --git a/common/log1pexp.m b/common/log1pexp.m index 3b5beb2..7ad0b9d 100644 --- a/common/log1pexp.m +++ b/common/log1pexp.m @@ -1,5 +1,5 @@ function y = log1pexp(x) -% accurately compute y = log(1+exp(x)) +% Accurately compute y = log(1+exp(x)) % reference: Accurately Computing log(1-exp(|a|)) Martin Machler seed = 33.3; y = x; diff --git a/common/logsumexp.m b/common/logsumexp.m index e622ef4..9838e4f 100644 --- a/common/logsumexp.m +++ b/common/logsumexp.m @@ -1,7 +1,7 @@ function s = logsumexp(X, dim) % Compute log(sum(exp(X),dim)) while avoiding numerical underflow. % By default dim = 1 (columns). -% Written by Michael Chen (sth4nth@gmail.com). +% Written by Mo Chen (sth4nth@gmail.com). if nargin == 1, % Determine which dimension sum will use dim = find(size(X)~=1,1); diff --git a/common/mgsog.m b/common/mgsog.m index 9a6cab6..003ce87 100644 --- a/common/mgsog.m +++ b/common/mgsog.m @@ -1,5 +1,6 @@ function [Q, R] = mgsog(X) % Modified Gram-Schmidt orthogonalization +% Written by Mo Chen (sth4nth@gmail.com). [d,n] = size(X); m = min(d,n); R = eye(m,n); diff --git a/common/mgson.m b/common/mgson.m index 3550f13..ecea8b3 100644 --- a/common/mgson.m +++ b/common/mgson.m @@ -1,6 +1,7 @@ function [Q, R] = mgson(X) % Modified Gram-Schmidt orthonormalization (numerical stable version of Gram-Schmidt algorithm) % which produces the same result as [Q,R]=qr(X,0) +% Written by Mo Chen (sth4nth@gmail.com). [d,n] = size(X); m = min(d,n); R = zeros(m,n); diff --git a/common/solvpd.m b/common/solvpd.m index 198836d..01000a6 100644 --- a/common/solvpd.m +++ b/common/solvpd.m @@ -1,7 +1,7 @@ function V = solvpd(A,B) % Compute A\B where A is a positive definite matrix % A: a positive difinie matrix -% Written by Michael Chen (sth4nth@gmail.com). +% Written by Mo Chen (sth4nth@gmail.com). [U,p] = chol(A); if p > 0 error('ERROR: the matrix is not positive definite.'); diff --git a/common/standardize.m b/common/standardize.m index 11a5805..233fadd 100644 --- a/common/standardize.m +++ b/common/standardize.m @@ -1,7 +1,7 @@ function [Y, s] = standardize(X) % Unitize the vectors to be unit length % By default dim = 1 (columns). -% Written by Michael Chen (sth4nth@gmail.com). +% Written by Mo Chen (sth4nth@gmail.com). if nargin == 1, % Determine which dimension sum will use dim = find(size(X)~=1,1); diff --git a/common/symeig.m b/common/symeig.m index c029259..6800a45 100644 --- a/common/symeig.m +++ b/common/symeig.m @@ -2,7 +2,7 @@ % Compute eigenvalues and eigenvectors of symmetric matrix % m == 's' smallest (default) % m == 'l' largest -% Written by Michael Chen (sth4nth@gmail.com). +% Written by Mo Chen (sth4nth@gmail.com). if nargin == 2 m = 's'; end diff --git a/common/ud.m b/common/ud.m index 0eb83e0..4f1ea34 100644 --- a/common/ud.m +++ b/common/ud.m @@ -1,5 +1,6 @@ function [U, D] = ud(X) % UD factorization U'*D*U=X'*X; +% Written by Mo Chen (sth4nth@gmail.com). [~,R] = qr(X,0); d = diag(R); D = d.^2; diff --git a/common/unitize.m b/common/unitize.m index 4a47556..feb12bb 100644 --- a/common/unitize.m +++ b/common/unitize.m @@ -1,7 +1,7 @@ function [Y, s] = unitize(X, dim) % Unitize the vectors to be unit length % By default dim = 1 (columns). -% Written by Michael Chen (sth4nth@gmail.com). +% Written by Mo Chen (sth4nth@gmail.com). if nargin == 1, % Determine which dimension sum will use dim = find(size(X)~=1,1); diff --git a/other/loggmpdf.m b/other/loggmpdf.m index a86af95..01c2c25 100644 --- a/other/loggmpdf.m +++ b/other/loggmpdf.m @@ -1,5 +1,6 @@ function r = loggmpdf(X, model) - +% Compute log pdf of a Gaussian mixture model. +% Written by Mo Chen (sth4nth@gmail.com). mu = model.mu; Sigma = model.Sigma; w = model.weight; diff --git a/other/plotgm.m b/other/plotgm.m index 02d7ac3..5915b4e 100644 --- a/other/plotgm.m +++ b/other/plotgm.m @@ -1,5 +1,6 @@ function plotgm(X, model) -% Written by Michael Chen (sth4nth@gmail.com). +% Plot 2d Gaussian mixture model. +% Written by Mo Chen (sth4nth@gmail.com). level = 64; n = 256; diff --git a/other/plotkde.m b/other/plotkde.m index eaee983..0b51a66 100644 --- a/other/plotkde.m +++ b/other/plotkde.m @@ -1,6 +1,6 @@ function plotkde(X, sigma2) -% Written by Michael Chen (sth4nth@gmail.com). - +% Plot 2d kernel density. +% Written by Mo Chen (sth4nth@gmail.com). if nargin < 2 sigma2 = 1e-1; end