Commit 07946078 authored by Davis King's avatar Davis King

Fixed a minor error in the LBFGS code.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403268
parent 3e484075
......@@ -181,9 +181,10 @@ namespace dlib
const T& funct_derivative
)
{
prev_direction = -funct_derivative;
if (been_used == false)
{
prev_direction = -funct_derivative;
been_used = true;
}
else
......@@ -207,7 +208,6 @@ namespace dlib
{
// This block of code is from algorithm 7.4 in the Nocedal book.
prev_direction = -funct_derivative;
alpha.resize(data.size());
for (unsigned long i = data.size()-1; i < data.size(); --i)
{
......@@ -228,10 +228,6 @@ namespace dlib
prev_direction += data[i].s * (alpha[i] - beta);
}
}
else
{
prev_derivative = -funct_derivative;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment