Commit 824eb455 authored by Davis King's avatar Davis King

Fixed a bug introduced in the last commit.

parent b4279045
...@@ -165,7 +165,10 @@ namespace dlib ...@@ -165,7 +165,10 @@ namespace dlib
subgradient = scale*subgradient; subgradient = scale*subgradient;
if(last_weight_1) if(last_weight_1)
{
w(w.size()-1) = 0;
subgradient(w.size()-1) = 0; subgradient(w.size()-1) = 0;
}
} }
private: private:
...@@ -386,6 +389,9 @@ namespace dlib ...@@ -386,6 +389,9 @@ namespace dlib
w, w,
num_nonnegative); num_nonnegative);
if(last_weight_1)
w(w.size()-1) = 1;
// put the solution into a decision function and then return it // put the solution into a decision function and then return it
decision_function<kernel_type> df; decision_function<kernel_type> df;
df.b = 0; df.b = 0;
......
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