public interface Optimizer
| Modifier and Type | Method and Description |
|---|---|
void |
addFitnessCalculationHandler(java.util.function.BiConsumer<java.util.Map<VariableReference,DoubleTensor>,java.lang.Double> fitnessCalculationHandler)
Adds a callback to be called whenever the optimizer evaluates the fitness of a point.
|
static java.util.Map<VariableReference,DoubleTensor> |
convertFromPoint(double[] point,
java.util.List<? extends Variable> latentVariables) |
static double[] |
convertToArrayPoint(java.util.List<? extends Variable<? extends NumberTensor,?>> latentVariables) |
static java.util.Map<VariableReference,DoubleTensor> |
convertToMapPoint(java.util.List<? extends Variable> variables) |
static StatusBar |
createFitnessStatusBar(Optimizer optimizerThatNeedsStatusBar) |
static java.util.List<Variable<? extends DoubleTensor,?>> |
getAsDoubleTensors(java.util.List<? extends Variable> variables) |
OptimizedResult |
maxAPosteriori()
This will use MAP estimation to optimize the values of latent vertices such that the
probability of the whole Bayesian network is maximised.
|
OptimizedResult |
maxLikelihood()
This method will use Maximum Likelihood estimation to optimize the values of latent vertices such that
the probability of the observed vertices is maximised.
|
static long |
numDimensions(long[] shape) |
void |
removeFitnessCalculationHandler(java.util.function.BiConsumer<java.util.Map<VariableReference,DoubleTensor>,java.lang.Double> fitnessCalculationHandler)
Removes a callback function that previously would have been called whenever the optimizer
evaluated the fitness of a point.
|
static Variable<DoubleTensor,?> |
toDoubleTensorVariable(Variable<?,?> v) |
static long |
totalNumberOfLatentDimensions(java.util.List<long[]> continuousLatentVariableShapes) |
void addFitnessCalculationHandler(java.util.function.BiConsumer<java.util.Map<VariableReference,DoubleTensor>,java.lang.Double> fitnessCalculationHandler)
fitnessCalculationHandler - a function to be called whenever the optimizer evaluates the fitness of a point.
The first argument to the handler represents the point being evaluated.
The second argument to the handler represents the fitness of that point.void removeFitnessCalculationHandler(java.util.function.BiConsumer<java.util.Map<VariableReference,DoubleTensor>,java.lang.Double> fitnessCalculationHandler)
fitnessCalculationHandler - the function to be removed from the list of fitness evaluation callbacksOptimizedResult maxAPosteriori()
OptimizedResult maxLikelihood()
static double[] convertToArrayPoint(java.util.List<? extends Variable<? extends NumberTensor,?>> latentVariables)
static java.util.Map<VariableReference,DoubleTensor> convertToMapPoint(java.util.List<? extends Variable> variables)
static java.util.Map<VariableReference,DoubleTensor> convertFromPoint(double[] point, java.util.List<? extends Variable> latentVariables)
static long totalNumberOfLatentDimensions(java.util.List<long[]> continuousLatentVariableShapes)
static long numDimensions(long[] shape)
static java.util.List<Variable<? extends DoubleTensor,?>> getAsDoubleTensors(java.util.List<? extends Variable> variables)
static Variable<DoubleTensor,?> toDoubleTensorVariable(Variable<?,?> v)