Repository navigation
Add target_coverage parameter to logarithmic_windows... - #27
jonscheunemann wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a target_coverage parameter to perspic.logger.logarithmic_windows() to derive base_window from max_steps, aiming to keep the ratio of measurement steps to training steps roughly constant across runs where max_steps varies (e.g., batch-size sweeps).
Changes:
- Added
target_coverage: Optional[float]tologarithmic_windows()and documented its intended usage/behavior. - Implemented
base_windowderivation fromtarget_coverage,max_steps, and the computed number of log points. - Added a new unit test suite covering
target_coveragebehavior and its interaction withadaptive_scale.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
perspic/logger.py |
Adds the target_coverage parameter, documents it, and derives base_window from it when provided. |
tests/unit/test_logger.py |
Introduces new unit tests validating target_coverage behavior and coverage constancy across a batch-size sweep. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| window_id_at_794 = next( | ||
| wid for wid, c in schedule.window_centers.items() if c == 794 | ||
| ) | ||
| window_id_at_0 = next( | ||
| wid for wid, c in schedule.window_centers.items() if c == 0 | ||
| ) | ||
| assert len(schedule.windows[window_id_at_0]) == 6 | ||
| assert len(schedule.windows[window_id_at_794]) == 11 |
|
If I understand correctly, the idea here is that for different batch sizes / num-steps you get the same coverage in measurements – so sth like 10% of all the steps are measured. This is a nice idea, and I'd like you to take this into account: Having a How does that compare to what's currently implemented? |
!should not be merged as the user has their own uv project for their model training!
and corresponding tests.
Added to hold the ratio of measurement steps to actual steps for increasing batchsizes almost constant