Fminlbfgs Details
From Ufldl
for
Fminlbfgs Details
Jump to:
navigation
,
search
The function <tt>fminlbfgs</tt> gives a BSD license implementation of L-BFGS (so appropriate use of this in commercial applications is okay). Here, we describe some details. You can download the [http://www.mathworks.com/matlabcentral/fx_files/23245/9/fminlbfgs_version2c.zip source code], or read a [http://www.mathworks.com/matlabcentral/fileexchange/23245-fminlbfgs-fast-limited-memory-optimizer description of the software] on the Mathworks website. It has an interface that is very similar to minFunc, and only very minor changes are required to get it to work. Specifically, the "<tt>options</tt>" variable needs to be specified differently (<tt>fminlbfgs</tt> uses different names for the parameters). Here's a parameter set that will work for <tt>fminlbfgs</tt>: <syntaxhighlight lang="matlab"> options.HessUpdate = 'lbfgs'; options.MaxIter = 400; options.Display = 'iter'; options.GradObj = 'on'; </syntaxhighlight> After setting <tt>options</tt> as above, the function call to run minFunc/fminlbfgs is exactly the same. Here's an example that works: <syntaxhighlight lang="matlab"> % Run fminlbfgs [opttheta, loss] = fminlbfgs( @(p) sparseAutoencoderLoss(p, ... visibleSize, hiddenSize, ... lambda, targetActivation, ... beta, patches), ... theta, options); </syntaxhighlight>
Return to
Fminlbfgs Details
.
Views
Page
Discussion
View source
History
Personal tools
Log in
ufldl resources
UFLDL Tutorial
Recommended Readings
wiki
Main page
Recent changes
Random page
Help
Search
Toolbox
What links here
Related changes
Special pages