Code covered by the BSD License
 callbackMFLDA (t, f, xi, ...
 computeGradientHS038 (x)
 computeGradientMFLDA (xi,...
 computeObjectiveHS038 (x)
 computeObjectiveMFLDA (xi...
 computelnZ (L, w, nu, eta...
 computelnZconst (nu, eta, D)
 computem (L, w, W, K, Phi)
 createsyntheticdata (nu, ...
 dirichletrnd (a)
 gammarnd (a)GAMMARND(A) produces a single random deviate from the Gamma
 genericcallback (t, f, x)
 mflda (nu, eta, w, xi, ga...
 mfldainit (W, K, w)
 examplehs038.mTest the "lbfgs" Matlab interface on the Hock & Schittkowski test problem
 exampleldaimages.mScript demonstrating the latent Dirichlet allocation model on synthetic
 lbfgsb.mLBFGSB Call the nonlinear boundconstrained solver that uses

View all files
MATLAB interface for LBFGSB
by
Peter Carbonetto
20 May 2007
Matlab interface to the LBFGSB nonlinear optimization algorithm

computem (L, w, W, K, Phi) 
function m = computem (L, w, W, K, Phi)
% Get the number of documents.
D = length(L);
% Initialize the counts "m".
m = zeros(W,K);
% Repeat for every document, then for every word in the document.
is = 0;
for d = 1:D
is = is(end) + (1:L(d));
for i = is
j = w(i);
m(j,:) = m(j,:) + Phi(:,i)';
end
end


Contact us