Search in sources :

Example 1 with ErrorStoppingCriteria

use of uk.ac.sussex.gdsc.smlm.fitting.nonlinear.stop.ErrorStoppingCriteria in project GDSC-SMLM by aherbert.

the class BoundedFunctionSolverTest method getLvm.

private static NonLinearFit getLvm(int bounded, int clamping, boolean mle) {
    final Gaussian2DFunction f = GaussianFunctionFactory.create2D(1, size, size, flags, null);
    final StoppingCriteria sc = new ErrorStoppingCriteria();
    sc.setMaximumIterations(100);
    final NonLinearFit solver = (bounded != 0 || clamping != 0) ? new BoundedNonLinearFit(f, sc, null) : new NonLinearFit(f, sc);
    if (clamping != 0) {
        final BoundedNonLinearFit bsolver = (BoundedNonLinearFit) solver;
        final ParameterBounds bounds = new ParameterBounds(f);
        bounds.setClampValues(defaultClampValues);
        bounds.setDynamicClamp(clamping == 2);
        bsolver.setBounds(bounds);
    }
    solver.setMle(mle);
    solver.setInitialLambda(1);
    return solver;
}
Also used : Gaussian2DFunction(uk.ac.sussex.gdsc.smlm.function.gaussian.Gaussian2DFunction) ErrorStoppingCriteria(uk.ac.sussex.gdsc.smlm.fitting.nonlinear.stop.ErrorStoppingCriteria) ErrorStoppingCriteria(uk.ac.sussex.gdsc.smlm.fitting.nonlinear.stop.ErrorStoppingCriteria)

Aggregations

ErrorStoppingCriteria (uk.ac.sussex.gdsc.smlm.fitting.nonlinear.stop.ErrorStoppingCriteria)1 Gaussian2DFunction (uk.ac.sussex.gdsc.smlm.function.gaussian.Gaussian2DFunction)1