Package samer.maths.opt
Class ZeroCrossingSparsity
- java.lang.Object
-
- samer.maths.opt.Constraints
-
- samer.maths.opt.ZeroCrossingSparsity
-
public class ZeroCrossingSparsity extends Constraints
Constraints and line minimisations for functions with gradient discontinuity at co-ordinate zeros (hyperplanes). The ZeroCrossingSparsity class handles this by checking for zero crossings during the line search. If a gradient discontinuity causes a change of sign in the gradient, that dimension is constrained and becomes inactive (drops out of minimisation). It can later be reactivated if the algorithm determines that the gradient no longer changes sign at that point.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class samer.maths.opt.Constraints
Constraints.Factory
-
-
Field Summary
Fields Modifier and Type Field and Description double[]
alphas
int
clipped
int[]
crossings
int
numcrossings
-
Constructor Summary
Constructors Constructor and Description ZeroCrossingSparsity(MinimiserBase minimiser)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static Constraints.Factory
factory()
int
getReleasableDimensions()
int
getReleasedDimension()
void
initialise()
constrain all dimensions which are currently set to zero.void
lineSearch(Condition convergence, CubicLineSearch ls, double beta0)
boolean
release(Datum P)
This finds the constrained dimension with the largest gradient, and if that absolute value of that gradient is bigger than 1, then releases that dimension so that it can take part in the optimizationvoid
report()
void
setGThreshold(double gt)
-
Methods inherited from class samer.maths.opt.Constraints
activate, activateAll, activeCount, deactivateAll, dot, eval2, inactivate, maxabs, mul, mul, negate, negate, step, sub, sub, zeroInactive
-
-
-
-
Field Detail
-
alphas
public double[] alphas
-
clipped
public int clipped
-
crossings
public int[] crossings
-
numcrossings
public int numcrossings
-
-
Constructor Detail
-
ZeroCrossingSparsity
public ZeroCrossingSparsity(MinimiserBase minimiser)
-
-
Method Detail
-
factory
public static Constraints.Factory factory()
-
setGThreshold
public void setGThreshold(double gt)
-
initialise
public void initialise()
constrain all dimensions which are currently set to zero.- Specified by:
initialise
in classConstraints
-
report
public void report()
- Overrides:
report
in classConstraints
-
release
public boolean release(Datum P)
This finds the constrained dimension with the largest gradient, and if that absolute value of that gradient is bigger than 1, then releases that dimension so that it can take part in the optimization- Overrides:
release
in classConstraints
-
getReleasedDimension
public int getReleasedDimension()
- Overrides:
getReleasedDimension
in classConstraints
-
getReleasableDimensions
public int getReleasableDimensions()
- Overrides:
getReleasableDimensions
in classConstraints
-
lineSearch
public void lineSearch(Condition convergence, CubicLineSearch ls, double beta0)
- Specified by:
lineSearch
in classConstraints
-
-