27 #ifndef SHARK_ALGORITHMS_DIRECTSEARCH_OPERATORS_TWO_POINT_STEP_SIZE_ADAPTATION_H 28 #define SHARK_ALGORITHMS_DIRECTSEARCH_OPERATORS_TWO_POINT_STEP_SIZE_ADAPTATION_H 62 m_alphaStep = alphaStep;
66 m_cAlpha = learningRate;
70 void init(
double initialStepSize){
71 m_stepSize = initialStepSize;
84 double fminus = f.
eval(point +m_alphaStep * m_stepSize * direction);
85 double fplus = f.
eval(point + (1+m_alphaStep) * m_stepSize * direction);
88 double alphaCurrent = fminus < fplus? std::log(m_alphaStep) : std::log(1+m_alphaStep);
89 m_alpha= (1 - m_cAlpha) * m_alpha + m_cAlpha * alphaCurrent;
90 m_stepSize *= std::exp(m_alpha);