public class SimulatedAnnealing
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
SimulatedAnnealing.AnnealingSchedule
An annealing schedule determines how T (temperature) changes as
a function of the current iteration number (i.e.
|
Constructor and Description |
---|
SimulatedAnnealing() |
Modifier and Type | Method and Description |
---|---|
static SimulatedAnnealing.AnnealingSchedule |
exponentialSchedule(int iterations,
double startT,
double endT) |
NetworkState |
getMaxAPosteriori(BayesianNetwork bayesNet,
int sampleCount) |
NetworkState |
getMaxAPosteriori(BayesianNetwork bayesNet,
int sampleCount,
SimulatedAnnealing.AnnealingSchedule annealingSchedule)
Finds the MAP using the default annealing schedule, which is an exponential decay schedule.
|
static SimulatedAnnealing |
withDefaultConfig() |
static SimulatedAnnealing |
withDefaultConfig(KeanuRandom random) |
public static SimulatedAnnealing withDefaultConfig()
public static SimulatedAnnealing withDefaultConfig(KeanuRandom random)
public NetworkState getMaxAPosteriori(BayesianNetwork bayesNet, int sampleCount)
public NetworkState getMaxAPosteriori(BayesianNetwork bayesNet, int sampleCount, SimulatedAnnealing.AnnealingSchedule annealingSchedule)
bayesNet
- a bayesian network containing latent verticessampleCount
- the number of samples to takeannealingSchedule
- the schedule to update T (temperature) as a function of sample number.public static SimulatedAnnealing.AnnealingSchedule exponentialSchedule(int iterations, double startT, double endT)
iterations
- the number of iterations annealing overstartT
- the value of T at iteration 0endT
- the value of T at the last iteration