Commit cb0b6a36 authored by Simon Maretzke's avatar Simon Maretzke
Browse files

Removed convergence warning - does not help much anyway

parent 4bef7355
function result = phaserec_nonlinTikhonov(holograms, fresnelNumbers, settings)
function [result, stats] = phaserec_nonlinTikhonov(holograms, fresnelNumbers, settings)
% PHASEREC_NONLINTIKHONOV reconstructs the phase based on a fully nonlinear
% phase-contrast model using Tikhonov regularization.
%
% ``result = phaserec_nonlinTikhonov(holograms, fresnelNumbers, settings)``
% ``[result, stats] = phaserec_nonlinTikhonov(holograms, fresnelNumbers, settings)``
%
% The method can be seen as a nonlinear generalization phaserec_ctf in the
% sense that both functions will yield exactly the same result in the limit
......@@ -123,9 +123,10 @@ defaults = phaserec_ctf;
%
% Control parameters for the iterative optimization by projected gradient-descent:
% Only modify if you know what you are doing!
% (see private function projectedGradientDescent for exact meaning of parameters)
defaults.optimization = struct;
defaults.optimization.maxIterations = 50; % maximum number of iterations
defaults.optimization.tolerance = 1e-2; % relative tolerance for determining convergence
defaults.optimization.maxIterations = 100; % maximum number of iterations
defaults.optimization.tolerance = 3e-3; % relative tolerance for determining convergence
defaults.optimization.verbose = false; % display status messages during optimization?
% Return default parameters if called without argument
......@@ -292,15 +293,6 @@ optimization.resiGradRef = gather(norm(gradRef(:)));
[result, stats] = projectedGradientDescent(TikhonovFunctional, initialGuess, optimization);
% Print warning if convergence has not been achiveded to the prescribed tolerance
if ~stats.isConverged
warning(sprintf(['Optimization method has not converged to the required accuracy (tolerance = %.2e) ', ...
'within maxIterations = %i steps (final residual was %.2e > tolerance). ', ...
'Result may be inaccurate.'], ...
optimization.tolerance, optimization.maxIterations, stats.resiGradRel(end)));
end
% Undo optional padding
result = gather(croparray(result, [settings.pady, settings.padx]));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment