diff --git a/MALKHUT/malkhut/long_e2e_3h.py b/MALKHUT/malkhut/long_e2e_3h.py index 1394508..babd252 100644 --- a/MALKHUT/malkhut/long_e2e_3h.py +++ b/MALKHUT/malkhut/long_e2e_3h.py @@ -385,8 +385,8 @@ def main(): import traceback traceback.print_exc() - # Phase 2: CMA-ES every 10 cycles (memory-heavy — keep infrequent) - if cycle % 10 == 0 and remaining > 600 and recent_episodes >= 20: + # Phase 2: CMA-ES every 20 cycles (memory-heavy — keep very infrequent) + if cycle % 20 == 0 and remaining > 900 and recent_episodes >= 20: phase = f"CYCLE {cycle} — CMA-ES" cma_scenarios = rng.sample(all_scenarios, min(3, len(all_scenarios))) try: @@ -398,11 +398,11 @@ def main(): cma_bests.append(best) if best.score > params.w_expected_pnl * 10: params = best.params - # Explicitly free CMA-ES state del best import gc; gc.collect() except Exception as e: print(f" CMA-ES error (cycle {cycle}): {e}", flush=True) + import gc; gc.collect() # Periodic report from rolling stats elapsed = time.time() - t_start