Class GradientBasedOptimiser
- java.lang.Object
-
- pulse.util.UpwardsNavigable
-
- pulse.util.Group
-
- pulse.util.Accessible
-
- pulse.util.PropertyHolder
-
- pulse.search.direction.PathOptimiser
-
- pulse.search.direction.GradientBasedOptimiser
-
- All Implemented Interfaces:
Serializable,Descriptive,Reflexive
- Direct Known Subclasses:
CompositePathOptimiser,LMOptimiser
public abstract class GradientBasedOptimiser extends PathOptimiser
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedGradientBasedOptimiser()Abstract constructor that sets up the defaultITERATION_LIMIT, ERROR_TOLERANCEandGRADIENT_RESOLUTIONfor thisPathSolver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected doubledx(NumericProperty defProp, double value)Calculates the gradient step.NumericPropertygetGradientResolution()doublegetGradientStep()Vectorgradient(GeneralTask task)Calculates theVectorgradient of the target function (the sum of squared residuals, SSR, for thistask.Set<NumericPropertyKeyword>listedKeywords()The types of the listed parameters for this class include:GRADIENT_RESOLUTION, ERROR_TOLERANCE, ITERATION_LIMIT.voidreset()Resets the defaultITERATION_LIMIT, ERROR_TOLERANCEandGRADIENT_RESOLUTIONvalues for thisPathSolver.voidset(NumericPropertyKeyword type, NumericProperty property)The accepted types are:GRADIENT_RESOLUTION, ERROR_TOLERANCE, ITERATION_LIMIT.voidsetGradientResolution(NumericProperty resolution)-
Methods inherited from class pulse.search.direction.PathOptimiser
compatibleWith, genericProperties, getErrorTolerance, getInstance, getMaxIterations, getSolver, ignoreSiblings, initState, iteration, prepare, setErrorTolerance, setInstance, setMaxIterations, setSolver, toString, update
-
Methods inherited from class pulse.util.PropertyHolder
addListener, areDetailsHidden, data, describe, firePropertyChanged, getDescriptor, getListeners, getPrefix, initListeners, isListedNumericType, isListedParameter, listedTypes, numericData, parameterListChanged, removeListeners, setPrefix, updateProperties, updateProperty
-
Methods inherited from class pulse.util.Accessible
accessibleChildren, genericProperty, numericProperties, numericProperty, property, update
-
Methods inherited from class pulse.util.UpwardsNavigable
addHierarchyListener, getHierarchyListeners, getParent, identify, removeHierarchyListener, removeHierarchyListeners, setParent, specificAncestor, tellParent
-
-
-
-
Method Detail
-
reset
public void reset()
Resets the defaultITERATION_LIMIT, ERROR_TOLERANCEandGRADIENT_RESOLUTIONvalues for thisPathSolver. In addition, sets up a list of search flags defined by theFlag.defaultListmethod.- Overrides:
resetin classPathOptimiser
-
gradient
public Vector gradient(GeneralTask task) throws SolverException
Calculates theVectorgradient of the target function (the sum of squared residuals, SSR, for thistask.If is the change in the target function associated with the change of the parameter , the i-th component of the gradient is equal to . The accuracy of this calculation depends on the value, which is roughly the
GRADIENT_RESOLUTION. Note however that instead of using a forward-difference scheme to calculate the gradient, this method utilises the central-difference calculation of the gradient, which significantly increases the overall accuracy of calculation. This means that to evaluate each component of this vector, theProblemassociated with thistaskis solved twice (for ).- Parameters:
task- aSearchTaskthat is being driven to the minimum of SSR- Returns:
- the gradient of the target function
- Throws:
SolverException
-
dx
protected double dx(NumericProperty defProp, double value)
Calculates the gradient step. Ensures dx is not zero even if the parameter values is. Applicable to discrete properties.- Parameters:
defProp- the default propertyvalue- the value of the parameter under the optimisation vector- Returns:
- the gradient step
-
setGradientResolution
public void setGradientResolution(NumericProperty resolution)
-
getGradientResolution
public NumericProperty getGradientResolution()
-
listedKeywords
public Set<NumericPropertyKeyword> listedKeywords()
The types of the listed parameters for this class include:
GRADIENT_RESOLUTION, ERROR_TOLERANCE, ITERATION_LIMIT. Also, all the flags in this class are treated as separate listed parameters.- Overrides:
listedKeywordsin classPathOptimiser- Returns:
- a set of
NumericPropertyKeywordinstances, which have been explicitly marked as a listed parameter for thisPropertyHolder. - See Also:
NumericPropertyKeyword
-
set
public void set(NumericPropertyKeyword type, NumericProperty property)
The accepted types are:GRADIENT_RESOLUTION, ERROR_TOLERANCE, ITERATION_LIMIT.- Overrides:
setin classPathOptimiser- Parameters:
type- the type, which must be equal by definition toproperty.getType().property- the property, which contains new information.
-
getGradientStep
public double getGradientStep()
-
-