m/Software/minFunc/minFunc.html
%%

% This file is from pmtk3.googlecode.com

options.Display = 'none';
setSeed(1); 
nClasses = 5;
nInstances = 1000;
%nInstances = 100;
nVars = 2;
[X,y] = makeData('multinomial',nInstances,nVars,nClasses);

% Add bias
X0 = X;
X = [ones(nInstances,1) X];


funObj = @(W)SoftmaxLoss2(W,X,y,nClasses);
lambda0 = 1e-4;
lambda = lambda0*ones(nVars+1,nClasses-1);
lambda(1,:) = 0; % Don't penalize biases
fprintf('Training multinomial logistic regression model...\n');
wSoftmax = minFu