From 2bc1416f6f751a7d6947bfa8fbfc56ef05f2533c Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Tue, 9 Sep 2025 21:16:08 +0800 Subject: [PATCH] tmp --- lgd_config.toml | 24 ++++++++++++++++++++++++ src/optimization/lgd_solver_ex.cpp | 3 +++ 2 files changed, 27 insertions(+) create mode 100644 lgd_config.toml diff --git a/lgd_config.toml b/lgd_config.toml new file mode 100644 index 0000000..6ed5b9c --- /dev/null +++ b/lgd_config.toml @@ -0,0 +1,24 @@ +# options of the Lévy-gradient-descent algorithms. +[lgd] +# hard stop after this many Lévy flights (0 = till mean-convergence test is satisfied). +flight_times = 1000 +# batch size for mean-convergence test; 0 disables the test. +batch = 0 +# random seed for Lévy generator; 0 = use current time. +seed = 0 +# stopping threshold on batch-mean change. +epsilon = 1e-5 +# std-dev of v for flight length = stddev_u / |stddev_v|^(1/beta). +stddev_v = 1.0 +# stability index (1,2) controlling flight-length range; larger → shorter jumps. +beta = 1.5 +# global step-size multiplier; larger → faster but possibly missed optima. +alpha = 0.01 +# gradient-norm below which an orthogonal escape step is triggered. +sigma = 1e-8 +# record only solutions whose objective ≤ lambda; negative = record all. +lambda = -1.0 +# first-order moment coefficient. +fmt = 0.5 +# second-order moment coefficient. +smt = 0.05 diff --git a/src/optimization/lgd_solver_ex.cpp b/src/optimization/lgd_solver_ex.cpp index 91e2e55..618e957 100644 --- a/src/optimization/lgd_solver_ex.cpp +++ b/src/optimization/lgd_solver_ex.cpp @@ -163,6 +163,9 @@ int main(int argc, char const *argv[]) ex2 e; e.CalObs(fm); + std::string config_file = "lgd_config.toml"; + e.set_lgd_para(config_file); + gctl::lgd_para my_para = e.default_lgd_para(); my_para.flight_times = 20000; my_para.batch = 100;