898 std::size_t classes = bias.size();
899 std::size_t numExamples = m_problem->getNumExamples();
900 std::size_t cardP = m_problem->cardP();
901 RealVector stepsize(classes, 0.01);
902 RealVector prev(classes,0);
903 RealVector step(classes);
906 unsigned long long iterations = 0;
911 solver.
solve(stop, &propInner);
917 RealMatrix dualGradient = m_problem->solutionGradient();
919 RealVector grad(classes,0);
921 for (std::size_t i=0; i<numExamples; i++){
922 std::size_t largestP = cardP;
923 double largest_value = 0.0;
924 for (std::size_t p=0; p<cardP; p++)
926 if (dualGradient(i,p) > largest_value)
928 largest_value = dualGradient(i,p);
932 if (largestP < cardP)
934 unsigned int y = m_problem->label(i);
936 for (std::size_t b=0; b != row.size; b++)
937 grad(row.entry[b].index) -= row.entry[b].value;
944 grad -= sum(grad) / classes;
948 for (std::size_t c=0; c<classes; c++)
952 step(c) = -stepsize(c);
954 step(c) = stepsize(c);
956 double gg = prev(c) * grad(c);
967 step -= sum(step) / classes;
972 performBiasUpdate(step,nu);
974 if (max(stepsize) < 0.01 * stop.
minAccuracy)
break;
982 prop->accuracy = m_problem->checkKKT();
983 prop->value = m_problem->functionValue();
984 prop->iterations = iterations;
985 prop->seconds = finish_time - start_time;