UGParameterEstimator.linesearches package
Submodules
UGParameterEstimator.linesearches.lineSearches module
- class UGParameterEstimator.linesearches.lineSearches.BacktrackingLineSearch(evaluator)
Bases:
LineSearchAn serial (as in not parallelized) version of a backtracking line search, halving the step size if no suitable step size according to the first wolfe conditions is found.
- c = 0.001
- doLineSearch(stepdirection, guess, target, J, r, result)
Executes the line search along a given direction
- Parameters
stepdirection (numpy array in parameter space) – the direction to search
guess (numpy array in parameter space) – the initial guess to do the step from
target (Evaluation) – the target of the calibration process
J (numpy array PxP) – the jacobian of the cost function in relation to the parameters
r (numpy array in measurement space) – the last residual vector
result – a tuple of final best guess, and overall
lowest residual value. Or (None, None), if an error occurred. :type result: tuple (numpy array, scalar)
- max_iterations = 15
- rho = 0.5
- class UGParameterEstimator.linesearches.lineSearches.LineSearch(evaluator)
Bases:
ABCBase class for all line searches describing the interface and providing a helper function
- abstract doLineSearch(stepdirection, guess, target, J, r, result)
Executes the line search along a given direction
- Parameters
stepdirection (numpy array in parameter space) – the direction to search
guess (numpy array in parameter space) – the initial guess to do the step from
target (Evaluation) – the target of the calibration process
J (numpy array PxP) – the jacobian of the cost function in relation to the parameters
r (numpy array in measurement space) – the last residual vector
result – a tuple of final best guess, and overall
lowest residual value. Or (None, None), if an error occurred. :type result: tuple (numpy array, scalar)
- measurementToNumpyArrayConverter(evaluations, target)
Helper function to convert an array of Evaluation. Each evaluation will be converted and interpolated using it’s getNumpyArrayLike method. None-values or Errors will be converted to None.
- Parameters
evaluations (list of Evaluations) – the evaluations to convert
target – Evaluation describing the format/time steps
each evaluation should be converted/interpolated to :type target: Evaluation :return: the results of the covnertions :rtype: list of numpy arrays
- class UGParameterEstimator.linesearches.lineSearches.LinearParallelLineSearch(evaluator, max_iterations=3, parallel_evaluations=10)
Bases:
LineSearchA line search executing multiple, uniformly distributed line search steps in parallel.
Multiple iterations, controlled by max_iterations, are performed sequentially, each with a smaller search window around the smallest window found in the last iteration.
If a suitable step size was found, as defined by the first wolfe condition with c = 1e-3, the search is stopped IF this value was not at the bounds of the search window. If it is, the search is continued in hope of a better step size.
- c = 0.001
- doLineSearch(stepdirection, guess, target, J, r, result)
Executes the line search along a given direction
- Parameters
stepdirection (numpy array in parameter space) – the direction to search
guess (numpy array in parameter space) – the initial guess to do the step from
target (Evaluation) – the target of the calibration process
J (numpy array PxP) – the jacobian of the cost function in relation to the parameters
r (numpy array in measurement space) – the last residual vector
result – a tuple of final best guess, and overall
lowest residual value. Or (None, None), if an error occurred. :type result: tuple (numpy array, scalar)
- max_iterations = 1
- parallel_evaluations = 10
- class UGParameterEstimator.linesearches.lineSearches.LogarithmicParallelLineSearch(evaluator, max_iterations=2, size=5, parallel_evaluations=10)
Bases:
LineSearchA parallel implementation of a line search, with the search values of the form 1/2^{-i} for multiple values of i in parallel.
If no suitable value (according to the first wolfe condition with c = 1e-3) is found, the next iteration is executed, with higher values for i.
- c = 0.001
- doLineSearch(stepdirection, guess, target, J, r, result)
Executes the line search along a given direction
- Parameters
stepdirection (numpy array in parameter space) – the direction to search
guess (numpy array in parameter space) – the initial guess to do the step from
target (Evaluation) – the target of the calibration process
J (numpy array PxP) – the jacobian of the cost function in relation to the parameters
r (numpy array in measurement space) – the last residual vector
result – a tuple of final best guess, and overall
lowest residual value. Or (None, None), if an error occurred. :type result: tuple (numpy array, scalar)
- highest_power = 0
- max_iterations = 2
- parallel_evaluations = 10
- size = 5