src/spsa.cpp
// Implementation based on J. Spall, "An Overview of the
// Simultaneous Perturbation Method for Efficient Optimization",
// Johns Hopkins APL Technical Digest 19 (1998), pp 482-492.
Implementation based on J. Spall, "An Overview of the
Simultaneous Perturbation Method for Efficient Optimization",
Johns Hopkins APL Technical Digest 19 (1998), pp 482-492.
Implementation based on J . Spall " An Overview of the Simultaneous Perturbation Method for Efficient Optimization " Johns Hopkins APL Technical Digest 19 ( 1998 ) pp 482 - 492 .
Spsa::Spsa(int d, const std::vector<double> &x0, int eval_limit): OptBase(d)
{
   options.alpha = 0.602;
   options.gamma = 0.101;
   options.c = 0.1; 
   options.a = 0.002;
   options.delta_min = 0.005;
   options.delta_max = 0.1;
   setEvaluationLimit(eval_limit);
   iterations = eval_limit/2;
   options.A = double(iterations)/10;
   setInitialPoints(x0);
   lower.resize(dim);
   lower.assign(dim,0.0);
   upper.resize(dim);
   upper.assign(dim,1.0);
}
Spsa :: Spsa ( int d , const std :: vector < double > & x0 , int eval_limit ) : OptBase ( d ) { options . alpha = 0.602 ; options . gamma = 0.101 ; options . c = 0.1 ; options . a = 0.002 ; options . delta_min = 0.005 ; options . delta_max = 0.1 ; setEvaluationLimit ( eval_limit ) ; iterations = eval_limit / 2 ; options . A = double ( iterations ) / 10 ; setInitialPoints ( x0 ) ; lower . resize ( dim ) ; lower . assign ( dim , 0.0 ) ; upper . resize ( dim ) ; upper . assign ( dim , 1.0 ) ; }
Implementation based on J. Spall, "An Overview of the
Simultaneous Perturbation Method for Efficient Optimization",
Johns Hopkins APL Technical Digest 19 (1998), pp 482-492.
Implementation based on J . Spall " An Overview of the Simultaneous Perturbation Method for Efficient Optimization " Johns Hopkins APL Technical Digest 19 ( 1998 ) pp 482 - 492 .
// The following two default constants are from Spall, 1998: //0.05; // The magnitude of the objective is much greater than theta (which // is scaled 0..1), so this constant must be small: // We currently assume values are scaled to the unit hypercube, // by default