We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d867b2 commit 7a90d6eCopy full SHA for 7a90d6e
admm/include/lbfgs.h
@@ -319,7 +319,19 @@ class LBFGSSolver : public Learner {
319
return 1. / (1. + exp(-inx));
320
}
321
322
- inline float PredToGrad(const Eigen::VectorXf & old_w,
+ float PredIns(const dmlc::Row<unsigned> &v,
323
+ const Eigen::VectorXf &old_w){
324
+ float inner = 0.0;
325
+ for(unsigned int i = 0; i < v.length;++i)
326
+ {
327
+ if(v.index[i] > num_fea)
328
+ continue;
329
+ inner += old_w[v.index[i]] * v.get_value(i);
330
+ }
331
+ return Sigmoid(inner);
332
333
+
334
+ inline float PredToGrad(const Eigen::VectorXf &old_w,
335
const dmlc::Row<unsigned> &v)
336
{
337
return PredIns(v, old_w) - v.get_label();
0 commit comments