Modifier and Type | Class and Description |
---|---|
static class |
GradientOptimizer.GradientOptimizerBuilder |
Constructor and Description |
---|
GradientOptimizer() |
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.
|
void |
addGradientCalculationHandler(java.util.function.BiConsumer<java.util.Map<VariableReference,DoubleTensor>,java.util.Map<? extends VariableReference,DoubleTensor>> gradientCalculationHandler)
Adds a callback to be called whenever the optimizer evaluates the gradient at a point.
|
static GradientOptimizer.GradientOptimizerBuilder |
builder() |
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.
|
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.
|
void |
removeGradientCalculationHandler(java.util.function.BiConsumer<java.util.Map<VariableReference,DoubleTensor>,java.util.Map<? extends VariableReference,DoubleTensor>> gradientCalculationHandler)
Removes a callback function that previously would have been called whenever the optimizer
evaluated the gradient at a point.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convertFromPoint, convertToArrayPoint, convertToMapPoint, createFitnessStatusBar, getAsDoubleTensors, numDimensions, toDoubleTensorVariable, totalNumberOfLatentDimensions
public static GradientOptimizer.GradientOptimizerBuilder builder()
public void addGradientCalculationHandler(java.util.function.BiConsumer<java.util.Map<VariableReference,DoubleTensor>,java.util.Map<? extends VariableReference,DoubleTensor>> gradientCalculationHandler)
gradientCalculationHandler
- a function to be called whenever the optimizer evaluates the gradient at a point.
The first argument to the handler represents the point being evaluated.
The second argument to the handler represents the gradient of that point.public void removeGradientCalculationHandler(java.util.function.BiConsumer<java.util.Map<VariableReference,DoubleTensor>,java.util.Map<? extends VariableReference,DoubleTensor>> gradientCalculationHandler)
gradientCalculationHandler
- the function to be removed from the list of gradient evaluation callbackspublic void addFitnessCalculationHandler(java.util.function.BiConsumer<java.util.Map<VariableReference,DoubleTensor>,java.lang.Double> fitnessCalculationHandler)
Optimizer
addFitnessCalculationHandler
in interface Optimizer
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.public void removeFitnessCalculationHandler(java.util.function.BiConsumer<java.util.Map<VariableReference,DoubleTensor>,java.lang.Double> fitnessCalculationHandler)
Optimizer
removeFitnessCalculationHandler
in interface Optimizer
fitnessCalculationHandler
- the function to be removed from the list of fitness evaluation callbackspublic OptimizedResult maxAPosteriori()
Optimizer
maxAPosteriori
in interface Optimizer
public OptimizedResult maxLikelihood()
Optimizer
maxLikelihood
in interface Optimizer