mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-29 12:39:41 +00:00
fix(rewards): harden distributional value target projection
- Clamp HL-Gauss targets - Handle terminal mask shapes safely - Align the default smoothing ratio with Stop Regressing
This commit is contained in:
@@ -133,3 +133,9 @@ def test_temporal_model_forward(monkeypatch):
|
||||
eval_loss, eval_metrics = model(batch)
|
||||
assert torch.isfinite(eval_loss)
|
||||
assert -1.0 <= eval_metrics["predicted_value_mean"] <= 0.0
|
||||
|
||||
targets = model.compute_target_distribution(
|
||||
torch.tensor([[-0.5], [-0.3]]),
|
||||
torch.tensor([[False], [True]]),
|
||||
)
|
||||
assert targets.shape == (2, model.config.num_value_bins)
|
||||
|
||||
Reference in New Issue
Block a user