You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on implementing the Geman-McClure loss function with a dynamic update of the theta parameter in each iteration to achieve Graduated Non-Convexity (GNC) results in the Ceres Solver. Despite following the recommended approach, my current implementation does not seem to influence the Ceres solver's behavior as expected. I would greatly appreciate your guidance on this matter. Below is a rough outline of my code:
// Geman-McClure
else if (loss == "Geman"){
double a =2;
loss_function = new GemanMcClureLoss(a);
}
// Geman-McClure loss function class
class GemanMcClureLoss : public ceres::LossFunction
{
public:
explicit GemanMcClureLoss(double delta) : delta_(delta), delta_square(delta * delta) {}
// Update theta value and reset the loss function's theta
theta /= 1.4;
loss_function->UpdateTheta(theta);
}
The text was updated successfully, but these errors were encountered:
arenas7307979
changed the title
Issue with Dynamic Theta Update in Geman-McClure Loss Function for Ceres Solver
Issue with Dynamic Theta Update in Graduated Non-Convexity for Ceres Solver
Jun 28, 2024
I am working on implementing the Geman-McClure loss function with a dynamic update of the theta parameter in each iteration to achieve Graduated Non-Convexity (GNC) results in the Ceres Solver. Despite following the recommended approach, my current implementation does not seem to influence the Ceres solver's behavior as expected. I would greatly appreciate your guidance on this matter. Below is a rough outline of my code:
// Geman-McClure
else if (loss == "Geman"){
double a =2;
loss_function = new GemanMcClureLoss(a);
}
// Geman-McClure loss function class
class GemanMcClureLoss : public ceres::LossFunction
{
public:
explicit GemanMcClureLoss(double delta) : delta_(delta), delta_square(delta * delta) {}
private:
const double delta_;
const double delta_square;
};
// Main loop for iterating and updating theta
int max_iter = 5;
for (int iter = 0; iter < max_iter; ++iter) {
ceres::Problem problem;
// Add residual blocks with Geman-McClure loss
ceres::CostFunction* cost_function = new ceres::AutoDiffCostFunction<ResidualFunction, 1, 1>(new ResidualFunction(res));
problem.AddResidualBlock(cost_function, loss_function, &initial_x);
// Solver configuration and solving
ceres::Solver::Options options;
ceres::Solver::Summary summary;
ceres::Solve(options, &problem, &summary);
// Update theta value and reset the loss function's theta
theta /= 1.4;
loss_function->UpdateTheta(theta);
}
The text was updated successfully, but these errors were encountered: