mlpack  master
exponential_schedule.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_CORE_OPTIMIZERS_SA_EXPONENTIAL_SCHEDULE_HPP
13 #define MLPACK_CORE_OPTIMIZERS_SA_EXPONENTIAL_SCHEDULE_HPP
14 
15 namespace mlpack {
16 namespace optimization {
17 
33 {
34  public:
35  /*
36  * Construct the ExponentialSchedule with the given parameter.
37  *
38  * @param lambda Cooling speed.
39  */
40  ExponentialSchedule(const double lambda = 0.001) : lambda(lambda) { }
41 
50  const double currentTemperature,
51  const double /* currentEnergy */)
52  {
53  return (1 - lambda) * currentTemperature;
54  }
55 
57  double Lambda() const { return lambda; }
59  double& Lambda() { return lambda; }
60 
61  private:
63  double lambda;
64 };
65 
66 } // namespace optimization
67 } // namespace mlpack
68 
69 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: binarize.hpp:18
double NextTemperature(const double currentTemperature, const double)
Returns the next temperature given current status.
double Lambda() const
Get the cooling speed, lambda.
The exponential cooling schedule cools the temperature T at every step according to the equation...
double & Lambda()
Modify the cooling speed, lambda.