652 std::size_t classes = bias.size();
653 std::size_t numExamples = m_problem->getNumExamples();
654 std::size_t cardP = m_problem->cardP();
655 RealVector stepsize(classes, 0.01);
656 RealVector prev(classes,0);
657 RealVector step(classes);
660 unsigned long long iterations = 0;
665 solver.
solve(stop, &propInner);
671 RealMatrix dualGradient = m_problem->solutionGradient();
673 RealVector grad(classes,0);
675 for (std::size_t i=0; i<numExamples; i++){
676 for (std::size_t p=0; p<cardP; p++){
677 double g = dualGradient(i,p);
680 unsigned int y = m_problem->label(i);
682 for (std::size_t b=0; b<row.size; b++)
683 grad(row.entry[b].index) -= row.entry[b].value;
702 grad -= sum(grad) / classes;
706 for (std::size_t c=0; c<classes; c++)
710 step(c) = -stepsize(c);
712 step(c) = stepsize(c);
714 double gg = prev(c) * grad(c);
725 step -= sum(step) / classes;
730 performBiasUpdate(step,nu);
732 if (max(stepsize) < 0.01 * stop.
minAccuracy)
break;
740 prop->accuracy = m_problem->checkKKT();
741 prop->value = m_problem->functionValue();
742 prop->iterations = iterations;
743 prop->seconds = finish_time - start_time;