87 if (program.get_n_weights() == 0)
91 auto init_weights = program.get_weights();
95 CFType cost_function(evaluator);
96 ceres::TinySolver<CFType> solver;
97 solver.options.max_num_iterations = 10;
99 typename decltype(solver)
::Parameters parameters = program.get_weights();
100 solver.Solve(cost_function, ¶meters);
111 if (solver.summary.final_cost < solver.summary.initial_cost)
113 program.set_weights(parameters);