-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add intervening mse plot, baseline #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add early stopping criterion that monitors max intervening mse between
steps 0 and tu-1. stops training early if:
- first divergence > min_divergence (default 1000 steps)
- max intervening mse doesn't improve by 10% in patience epochs (default 10)
this prevents wasted training time when the model cannot learn to
predict intermediate steps between observation points.
config parameters:
- early_stop_intervening_mse: enable/disable (default false)
- early_stop_patience_epochs: patience for improvement (default 10)
- early_stop_min_divergence: min divergence threshold (default 1000)
new metric tracked in diagnostics:
- time_aligned_mse_{rollout_type}_max_intervening_0_to_tu: max mse in
steps 0 to tu-2 (worst case over starts, avg over neurons)
early stopping checkpoint saved as checkpoint_early_stop.pt when triggered.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
use load_val_only() instead of load_dataset() and load neuron_data separately using load_metadata() + NeuronData.from_metadata(). fixes ValueError: not enough values to unpack (expected 7, got 5)
neuron_data is guaranteed to be the same across configs, so just reuse the already-loaded neuron_data instead of loading it again
the alpha for linear interpolation should be relative to t_start and t_end, not include start_idx. start_idx is the absolute time index while t_start and t_end are relative time points (0, tu, 2*tu, etc). fixes incorrect linear interpolation MSE (~1e4 instead of reasonable values)
…rvations interpolate between observations at t_start and t_end using: alpha = (actual_time - t_start) / (t_end - t_start) this ensures MSE=0 at observation points (tu, 2*tu, 3*tu, ...)
fixes: - use correct observation indices: x_gt[i*tu] instead of x_gt[i] - only compute mse on predictions (first total_steps), not final observation - convert to numpy array before accumulating ensures mse is 0 at observation points (tu, 2*tu, 3*tu, ...)
adds small dots (markersize=3) to the model mse line to show all individual time steps, while keeping large markers (s=100) for observation points where loss is applied
increase markersize from 3 to 5 and use circle markers for better visibility
use scatter with s=50 for all data points and s=100 for training points, making it clearer which points are observation points vs training points
- add s=30 markers to linear interpolation baseline - reduce model mse markers from s=50 to s=30 - remove separate legend entry for data points - keep training points at s=100 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix post_run_analyze
add a new baseline for linear interpolation
add a plot of intervening mse along with constant baseline

add an early stop if the intervening mse doesn't improve too much (and we have some roll out stability)