MCPcopy Create free account
hub / github.com/ComputationalRobotics/XM-code / optimize

Method optimize

XM/include/Optimization/optimization.h:33–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 Optimizer(opt_objective func, opt_gradient grad): F(func), gradF(grad){}
32
33 void optimize(opt_var& initial_guess, opt_option& option,DeviceBlasHandle& cublas_H) {
34 x.copy(initial_guess);
35 gradx.copy(initial_guess);
36 switch (option.method) {
37 case opt_option::GradientDescent: {
38 gradientdecent(option.lr_gd, option.max_iteration_gd,cublas_H);
39 break;
40 }
41 case opt_option::NewtonMethod: {
42
43 std::cout << "Newton Method is not implemented yet." << std::endl;
44 break;
45 }
46 }
47
48 }
49
50 void gradientdecent(double lr, size_l maxitr,DeviceBlasHandle& cublas_H){
51 std::cout << "Initial value is:" << F(x) << std::endl;

Callers

nothing calls this directly

Calls 1

copyMethod · 0.80

Tested by

no test coverage detected