-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix silent calibration failures #214
Conversation
Codecov Report
@@ Coverage Diff @@
## main #214 +/- ##
==========================================
- Coverage 11.02% 10.17% -0.86%
==========================================
Files 45 39 -6
Lines 6087 5190 -897
==========================================
- Hits 671 528 -143
+ Misses 5416 4662 -754
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Preview page for your plugin is ready here: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@talonchandler How do you feel about a more informative filename such as debug_calibration.py
for the new script? Other than that I think we are good to merge.
Good call...fixed. |
Thanks for putting in this work @talonchandler! I liked your As you say, from the repeated calibrations you did, I think it's clear that our calibration algorithm needs a bit more work. (2,4), (6,4), and (9,3) are hardly examples of good calibration. At this point, I don't have a clear sense of where these discrepancies may come from. Do you know if the optimization algorithm reached approximately equal intensities in all cases? One thing I've been suspicious about is whether we allow enough time for the LCs to settle into a new state. For example, in recOrder/recOrder/calib/Calibration.py Lines 425 to 426 in f7946b9
|
The following figure summarizes the fix in this PR:
Caption: before this PR the calibrations were being optimized over a region of fixed width = 0.05 waves. For small swing values (swing = 0.04 pictured here), the optimization region crossed the extinction state which often resulted in calibrated states on the wrong side of the extinction state.
This PR scales the optimization with the swing so that the calibrated states are always on the correct side of the extinction state.
Details: I've changed the LCA search region from a fixed
0.05
tomin(swing/ratio, 0.05)
for 4-state andmin(swing, 0.05)
for 5-state calibrations. This means that the behavior for large swings (>0.05 for 5-state and >0.1 for 4-state) will be unchanged---only small-swing calibrations are affected by this PR.More data: this PR also includes an automation script that I used to collect 40 calibrations in all combinations of:
Below are the LCA/LCB plots which show:
Caption: Columns correspond to decreasing swing left to right. First 5 rows correspond to repeats of the 4-state algorithm and the last 5 rows correspond to repeats of the 5-state algorithm.