From 86a06f4131f80ea92fadf4cd9509f87b4e67f58f Mon Sep 17 00:00:00 2001 From: Maksym Zhelyeznyakov Date: Fri, 17 Oct 2025 19:02:59 +0200 Subject: [PATCH] updates --- .../detail/differentiable_opt_utilties.hpp | 103 ++++- .../optimization/detail/gradient_opt_base.hpp | 69 ++- .../detail/line_search_policies.hpp | 182 +++++++- .../detail/rdiff_optimization_policies.hpp | 106 +++-- .../math/optimization/gradient_descent.hpp | 191 ++++---- .../math/optimization/gradient_optimizers.hpp | 7 +- include/boost/math/optimization/lbfgs.hpp | 256 ++++++++--- include/boost/math/optimization/minimizer.hpp | 246 ++++++---- include/boost/math/optimization/nesterov.hpp | 243 ++++++---- test/test_gradient_descent_optimizer.cpp | 424 +++++++++--------- test/test_lbfgs.cpp | 175 +++++++- test/test_nesterov_optimizer.cpp | 33 +- 12 files changed, 1394 insertions(+), 641 deletions(-) diff --git a/include/boost/math/optimization/detail/differentiable_opt_utilties.hpp b/include/boost/math/optimization/detail/differentiable_opt_utilties.hpp index 32bd8796f..48e80ae71 100644 --- a/include/boost/math/optimization/detail/differentiable_opt_utilties.hpp +++ b/include/boost/math/optimization/detail/differentiable_opt_utilties.hpp @@ -1,5 +1,10 @@ +// Copyright Maksym Zhelyenzyakov 2025-2026. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) #ifndef DIFFERENTIABLE_OPT_UTILITIES_HPP #define DIFFERENTIABLE_OPT_UTILITIES_HPP +#include #include #include #include @@ -10,47 +15,92 @@ namespace boost { namespace math { namespace optimization { -template struct update_policy_real_type; -template struct update_policy_real_type; +namespace rdiff = boost::math::differentiation::reverse_mode; -template