.. index:: pair: class; funcmin::ADAM .. _doxid-classfuncmin_1_1_a_d_a_m: class funcmin::ADAM =================== .. toctree:: :hidden: Overview ~~~~~~~~ Adaptive Moment Estimation (:ref:`ADAM `) optimizer. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class ADAM { public: // fields bool :target:`failedOptim`; // construction :target:`ADAM`(); virtual :target:`~ADAM`(); // methods template void :ref:`optimize`(const :ref:`gpr::EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, Eigen::VectorXd& w, FuncName func_to_min, ClassName& holder, double); void :ref:`setAlgorithmSettings`(const :ref:`gpr::AdamOptimizationSettings`& _settings); }; .. _details-classfuncmin_1_1_a_d_a_m: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Adaptive Moment Estimation (:ref:`ADAM `) optimizer. Methods ------- .. index:: pair: function; optimize .. _doxid-classfuncmin_1_1_a_d_a_m_1a524f5042eca08434b803fba76ed1ab81: .. ref-code-block:: cpp :class: doxyrest-title-code-block template void optimize(const :ref:`gpr::EigenMatrix`& x, const Eigen::VectorXd& x_ind, const Eigen::VectorXd& y, Eigen::VectorXd& w, FuncName func_to_min, ClassName& holder, double) Optimization function using the :ref:`ADAM ` algorithm. .. note:: Moment vectors (m, v) are updated in-place to avoid temporaries. Bias-corrected vectors (m_hat, v_hat) and the weight update are pre-allocated before the iteration loop to eliminate per-iteration heap allocations. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - x - Training inputs (passed to func_to_min) * - x_ind - Training input indices (passed to func_to_min) * - y - Training targets (passed to func_to_min) * - w - On input, the initial parameters; on output, the optimized parameters. * - func_to_min - The function to minimize. It must calculate energy and gradient. * - holder - Object of the class that owns the function func_to_min. .. index:: pair: function; setAlgorithmSettings .. _doxid-classfuncmin_1_1_a_d_a_m_1af7fd293feb71b929cdcf2dd882b68d15: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setAlgorithmSettings(const :ref:`gpr::AdamOptimizationSettings`& _settings) Set parameters of the optimization algorithm. For :ref:`ADAM `, this includes learning_rate, beta1, beta2, epsilon, etc.