public class InverseRealTransformGradientDescent extends Object implements RealTransform
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
logger |
Constructor and Description |
---|
InverseRealTransformGradientDescent(int ndims,
DifferentiableRealTransform xfm) |
Modifier and Type | Method and Description |
---|---|
void |
apply(double[] s,
double[] t)
Apply the
RealTransform to a source vector to obtain a target
vector. |
void |
apply(float[] src,
float[] tgt)
Deprecated.
|
void |
apply(RealLocalizable src,
RealPositionable tgt)
|
boolean |
armijoCondition(double c,
double t)
Returns true if the armijo condition is satisfied.
|
double |
backtrackingLineSearch(double t0)
Uses Backtracking Line search to determine a step size.
|
double |
backtrackingLineSearch(double c,
double beta,
int maxtries,
double t0)
Uses Backtracking Line search to determine a step size.
|
RealTransform |
copy()
Create a deep copy of this
RealTransform . |
double[] |
getDirection() |
double |
getError() |
double[] |
getErrorVector() |
double[] |
getEstimate() |
double |
inverseTol(double[] target,
double[] guess,
double tolerance,
int maxIters) |
int |
numSourceDimensions()
Returns n, the minimal number of dimension of the source vector.
|
int |
numTargetDimensions()
Returns m, the minimal dimension of the target vector.
|
void |
regularizeJacobian()
Changes jacobian (J) to be:
( 1-eps ) * J + ( eps ) * I
note jacRegMatrix = eps * I
|
void |
setBeta(double beta) |
void |
setC(double c) |
void |
setEstimate(double[] est) |
void |
setEstimateXfm(double[] est) |
void |
setFixZ(boolean fixZ) |
void |
setGuess(double[] guess) |
void |
setJacobianEstimateStep(double jacStep) |
void |
setJacobianRegularizationEps(double e) |
void |
setMaxIters(int maxIters) |
void |
setMaxStep(double maxStep) |
void |
setMinStep(double minStep) |
void |
setStepSize(double stepSize) |
void |
setStepSizeMaxTries(int stepSizeMaxTries) |
void |
setTarget(double[] tgt) |
void |
setTolerance(double tol) |
double |
squaredError(double[] x) |
static double |
sumSquaredErrors(double[] y,
double[] x) |
void |
updateError() |
void |
updateEstimate(double stepSize) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isIdentity
public InverseRealTransformGradientDescent(int ndims, DifferentiableRealTransform xfm)
public void setBeta(double beta)
public void setC(double c)
public void setTolerance(double tol)
public void setMaxIters(int maxIters)
public void setFixZ(boolean fixZ)
public void setStepSize(double stepSize)
public void setMinStep(double minStep)
public void setMaxStep(double maxStep)
public void setJacobianEstimateStep(double jacStep)
public void setJacobianRegularizationEps(double e)
public void setStepSizeMaxTries(int stepSizeMaxTries)
public void setTarget(double[] tgt)
public double[] getErrorVector()
public double[] getDirection()
public void setEstimate(double[] est)
public void setEstimateXfm(double[] est)
public double[] getEstimate()
public double getError()
public int numSourceDimensions()
RealTransform
numSourceDimensions
in interface RealTransform
public int numTargetDimensions()
RealTransform
numTargetDimensions
in interface RealTransform
public RealTransform copy()
RealTransform
RealTransform
.
Deep copying is required to make sure that stateful RealTransforms
can be duplicated for concurrent code.
copy
in interface RealTransform
public void setGuess(double[] guess)
public void apply(double[] s, double[] t)
RealTransform
RealTransform
to a source vector to obtain a target
vector.apply
in interface RealTransform
s
- source coordinates, length must be >=
RealTransform.numSourceDimensions()
t
- set this to the target coordinates, length must be >=
RealTransform.numTargetDimensions()
@Deprecated public void apply(float[] src, float[] tgt)
RealTransform
RealTransform
to a source vector to obtain a target
vector.apply
in interface RealTransform
src
- source coordinates, length must be >=
RealTransform.numSourceDimensions()
tgt
- set this to the target coordinates, length must be >=
RealTransform.numTargetDimensions()
public void apply(RealLocalizable src, RealPositionable tgt)
RealTransform
apply
in interface RealTransform
src
- source coordinates, numDimensions()
must be >=
RealTransform.numSourceDimensions()
tgt
- set this to the target coordinates,
numDimensions()
must
be >=
RealTransform.numTargetDimensions()
public double inverseTol(double[] target, double[] guess, double tolerance, int maxIters)
public void regularizeJacobian()
public double backtrackingLineSearch(double t0)
t0
- initial step sizepublic double backtrackingLineSearch(double c, double beta, int maxtries, double t0)
c
- the armijoCondition parameterbeta
- the fraction to multiply the step size at each iteration (
less than 1 )maxtries
- max number of triest0
- initial step sizepublic boolean armijoCondition(double c, double t)
c
- the c parametert
- the step sizepublic double squaredError(double[] x)
public void updateEstimate(double stepSize)
public void updateError()
public static double sumSquaredErrors(double[] y, double[] x)
Copyright © 2015–2022 ImgLib2. All rights reserved.