Hi,
I am modelling a nonlinear optimization problem using ceres and the autodiff. I really love the overall framework!
For evaluating the objective function I'm using the Jet types for automatic differentiation.
E.g.
T fitVal = *param1 + *param2;
pResidual[0] = (T)val - fitVal;
This works nice, however, I actually want to make shure that the objective function will be bounded by some range.
E.g.
if(fitVal) < 0.0)
fitVal = (T)0.0;
if(fitVal > 255.0)
fitVal = (T)255.0;
However, doing it like this will generate artifacts in the fitted data. Is something like this anyhow possible using the automatic differentiation? Because the modeled function is then not smooth anymore?
Regards
Tobias