15 #ifndef MLPACK_CORE_OPTIMIZERS_SGDR_SNAPSHOT_SGDR_HPP 16 #define MLPACK_CORE_OPTIMIZERS_SGDR_SNAPSHOT_SGDR_HPP 25 namespace optimization {
60 template<
typename UpdatePolicyType = MomentumUpdate>
88 const double multFactor = 2.0,
89 const size_t batchSize = 1000,
90 const double stepSize = 0.01,
91 const size_t maxIterations = 100000,
92 const double tolerance = 1e-5,
93 const bool shuffle =
true,
94 const size_t snapshots = 5,
95 const bool accumulate =
true,
96 const UpdatePolicyType& updatePolicy = UpdatePolicyType());
107 template<
typename DecomposableFunctionType>
108 double Optimize(DecomposableFunctionType&
function, arma::mat& iterate);
172 #include "snapshot_sgdr_impl.hpp" double Optimize(DecomposableFunctionType &function, arma::mat &iterate)
Optimize the given function using SGDR.
const DecayPolicyType & DecayPolicy() const
Get the step size decay policy.
UpdatePolicyType & UpdatePolicy()
Modify the update policy.
double StepSize() const
Get the step size.
bool Shuffle() const
Get whether or not the individual functions are shuffled.
const UpdatePolicyType & UpdatePolicy() const
Get the update policy.
SnapshotSGDR(const size_t epochRestart=50, const double multFactor=2.0, const size_t batchSize=1000, const double stepSize=0.01, const size_t maxIterations=100000, const double tolerance=1e-5, const bool shuffle=true, const size_t snapshots=5, const bool accumulate=true, const UpdatePolicyType &updatePolicy=UpdatePolicyType())
Construct the SnapshotSGDR optimizer with snapshot ensembles with the given function and parameters...
double Tolerance() const
Get the tolerance for termination.
size_t BatchSize() const
Get the batch size.
The core includes that mlpack expects; standard C++ includes and Armadillo.
double Tolerance() const
Get the tolerance for termination.
bool & Shuffle()
Modify whether or not the individual functions are shuffled.
This class is based on Mini-batch Stochastic Gradient Descent class and simulates a new warm-started ...
size_t & MaxIterations()
Modify the maximum number of iterations (0 indicates no limit).
std::vector< arma::mat > Snapshots() const
Get the snapshots.
size_t MaxIterations() const
Get the maximum number of iterations (0 indicates no limit).
double StepSize() const
Get the step size.
std::vector< arma::mat > & Snapshots()
Modify the snapshots.
double & Tolerance()
Modify the tolerance for termination.
double & StepSize()
Modify the step size.
const UpdatePolicyType & UpdatePolicy() const
Get the update policy.
bool Shuffle() const
Get whether or not the individual functions are shuffled.
size_t BatchSize() const
Get the batch size.
size_t MaxIterations() const
Get the maximum number of iterations (0 indicates no limit).
size_t & BatchSize()
Modify the batch size.
std::vector< arma::mat > Snapshots() const
Get the snapshots.