refactor(sac): decouple algorithm hyperparameters from policy config

This commit is contained in:
Khalil Meftah
2026-04-18 16:40:56 +02:00
parent 2487a6ee6d
commit a84b0e8132
3 changed files with 42 additions and 35 deletions
+3 -2
View File
@@ -136,12 +136,13 @@ def test_sac_algorithm_config_registered():
def test_sac_algorithm_config_from_policy_config():
"""from_policy_config should copy relevant fields."""
"""from_policy_config should copy algorithm hyperparameters from the policy config."""
sac_cfg = _make_sac_config(utd_ratio=4, policy_update_freq=2)
algo_cfg = SACAlgorithmConfig.from_policy_config(sac_cfg)
assert algo_cfg.sac_config is sac_cfg
assert algo_cfg.utd_ratio == 4
assert algo_cfg.policy_update_freq == 2
assert algo_cfg.clip_grad_norm == sac_cfg.grad_clip_norm
assert algo_cfg.grad_clip_norm == sac_cfg.grad_clip_norm
# ===========================================================================