Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion miles/ray/rollout.py
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,18 @@ def _is_zero_std(samples: list[Sample]):

interesting_rewards = [str(round(g[0].get_reward_value(args), 1)) for g in interesting_sample_groups]

return {f"zero_std/count_{reward}": len(items) for reward, items in group_by(interesting_rewards).items()}
counts = {reward: len(items) for reward, items in group_by(interesting_rewards).items()}
log_dict = {f"zero_std/count_{reward}": count for reward, count in counts.items()}

# Percentages over total groups, so "too hard" (all-0) and "too easy"
# (all-1) rates are comparable across runs without needing to know the
# rollout batch size.
total_groups = len(all_sample_groups)
if total_groups > 0:
log_dict["zero_std/all_zero_percentage"] = counts.get("0.0", 0) / total_groups
log_dict["zero_std/all_one_percentage"] = counts.get("1.0", 0) / total_groups

return log_dict


def _compute_spec_metrics(args, all_samples: list[Sample]):
Expand Down
Loading