From 2642286c868ee079faa67538f0e76ab7aa1c3ac8 Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Tue, 3 Mar 2026 00:10:02 +0100 Subject: [PATCH] feat(hyperopt): record elapsed_seconds metric in all hyperopt binaries Co-Authored-By: Claude Opus 4.6 --- crates/ml/examples/hyperopt_baseline_rl.rs | 2 ++ crates/ml/examples/hyperopt_baseline_supervised.rs | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/crates/ml/examples/hyperopt_baseline_rl.rs b/crates/ml/examples/hyperopt_baseline_rl.rs index fc5618044..d3ff230a8 100644 --- a/crates/ml/examples/hyperopt_baseline_rl.rs +++ b/crates/ml/examples/hyperopt_baseline_rl.rs @@ -183,6 +183,7 @@ fn run_dqn_hyperopt(args: &Args, parallel: usize, device: &candle_core::Device) training_metrics::set_hyperopt_trial("dqn", result.all_trials.len() as f64, args.trials as f64); training_metrics::set_hyperopt_best_objective("dqn", result.best_objective); + training_metrics::set_hyperopt_elapsed("dqn", elapsed); info!("DQN hyperopt complete:"); info!(" Best objective: {:.6}", result.best_objective); @@ -252,6 +253,7 @@ fn run_ppo_hyperopt(args: &Args, parallel: usize, device: &candle_core::Device) training_metrics::set_hyperopt_trial("ppo", result.all_trials.len() as f64, args.trials as f64); training_metrics::set_hyperopt_best_objective("ppo", result.best_objective); + training_metrics::set_hyperopt_elapsed("ppo", elapsed); info!("PPO hyperopt complete:"); info!(" Best objective: {:.6}", result.best_objective); diff --git a/crates/ml/examples/hyperopt_baseline_supervised.rs b/crates/ml/examples/hyperopt_baseline_supervised.rs index dfff07887..7c576d2dd 100644 --- a/crates/ml/examples/hyperopt_baseline_supervised.rs +++ b/crates/ml/examples/hyperopt_baseline_supervised.rs @@ -148,6 +148,7 @@ fn run_tft_hyperopt(args: &Args) -> Result { training_metrics::set_hyperopt_trial("tft", result.all_trials.len() as f64, args.trials as f64); training_metrics::set_hyperopt_best_objective("tft", result.best_objective); + training_metrics::set_hyperopt_elapsed("tft", elapsed); info!("TFT hyperopt complete:"); info!(" Best objective: {:.6}", result.best_objective); @@ -206,6 +207,7 @@ fn run_mamba2_hyperopt(args: &Args) -> Result { training_metrics::set_hyperopt_trial("mamba2", result.all_trials.len() as f64, args.trials as f64); training_metrics::set_hyperopt_best_objective("mamba2", result.best_objective); + training_metrics::set_hyperopt_elapsed("mamba2", elapsed); info!("Mamba2 hyperopt complete:"); info!(" Best objective: {:.6}", result.best_objective); @@ -265,6 +267,7 @@ fn run_liquid_hyperopt(args: &Args) -> Result { training_metrics::set_hyperopt_trial("liquid", result.all_trials.len() as f64, args.trials as f64); training_metrics::set_hyperopt_best_objective("liquid", result.best_objective); + training_metrics::set_hyperopt_elapsed("liquid", elapsed); info!("Liquid hyperopt complete:"); info!(" Best objective: {:.6}", result.best_objective); @@ -324,6 +327,7 @@ fn run_tggn_hyperopt(args: &Args) -> Result { training_metrics::set_hyperopt_trial("tggn", result.all_trials.len() as f64, args.trials as f64); training_metrics::set_hyperopt_best_objective("tggn", result.best_objective); + training_metrics::set_hyperopt_elapsed("tggn", elapsed); info!("TGGN hyperopt complete:"); info!(" Best objective: {:.6}", result.best_objective); @@ -383,6 +387,7 @@ fn run_tlob_hyperopt(args: &Args) -> Result { training_metrics::set_hyperopt_trial("tlob", result.all_trials.len() as f64, args.trials as f64); training_metrics::set_hyperopt_best_objective("tlob", result.best_objective); + training_metrics::set_hyperopt_elapsed("tlob", elapsed); info!("TLOB hyperopt complete:"); info!(" Best objective: {:.6}", result.best_objective); @@ -442,6 +447,7 @@ fn run_kan_hyperopt(args: &Args) -> Result { training_metrics::set_hyperopt_trial("kan", result.all_trials.len() as f64, args.trials as f64); training_metrics::set_hyperopt_best_objective("kan", result.best_objective); + training_metrics::set_hyperopt_elapsed("kan", elapsed); info!("KAN hyperopt complete:"); info!(" Best objective: {:.6}", result.best_objective); @@ -501,6 +507,7 @@ fn run_xlstm_hyperopt(args: &Args) -> Result { training_metrics::set_hyperopt_trial("xlstm", result.all_trials.len() as f64, args.trials as f64); training_metrics::set_hyperopt_best_objective("xlstm", result.best_objective); + training_metrics::set_hyperopt_elapsed("xlstm", elapsed); info!("xLSTM hyperopt complete:"); info!(" Best objective: {:.6}", result.best_objective); @@ -560,6 +567,7 @@ fn run_diffusion_hyperopt(args: &Args) -> Result { training_metrics::set_hyperopt_trial("diffusion", result.all_trials.len() as f64, args.trials as f64); training_metrics::set_hyperopt_best_objective("diffusion", result.best_objective); + training_metrics::set_hyperopt_elapsed("diffusion", elapsed); info!("Diffusion hyperopt complete:"); info!(" Best objective: {:.6}", result.best_objective);