-
Notifications
You must be signed in to change notification settings - Fork 56
WIP: TVD objective in GST #506
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
base: develop
Are you sure you want to change the base?
Conversation
…me a file in test/performance so that it doesnt get discovered by testing frameworks like pytest
…t commit will simpify further, which may have consequences from the perspective of floating point arithmetic. Checking in NOW in case we want to revert to this version for numerical reasons.
…eparately, modify docstring for run_long_sequence_gst to be consistent with its implementation (including leaving notes for later).
…uge_group. Having the casting occur here makes sense, since a model has access to the associated StateSpace, Basis, and Evotype.
…tchboard.objfn_builder was used when switchboard.objfn_builder_modvi should have been used
@pcwysoc I merged in changes from develop and now I'm getting errors in my example script. I'm working on getting this ready for you to experiment with. |
@pcwysoc my latest push includes an example notebook you can use to get started. LMK if you have any questions! |
|
||
HISTORICAL NOTE: "XX" indicates that we've at least _intended_ for the | ||
keyword argument to be removed. I've removed documentation for options | ||
that we never reference in the code (truncScheme, estimate_label, and | ||
missingDataAction). |
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.
Could move this change (and related changes below) to another PR.
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.
Need to document why changes to this file were needed.
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.
Can move this change to another PR.
# QUESTION: could I just call the base class's implementation of terms and then scale the | ||
# result? If so then I can avoid a ton of code duplication. |
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.
Need to resolve this question before merge.
# QUESTION: could I just call the base class's implementation of dterms and then scale the | ||
# leading rows of the result? If so then I can avoid a ton of code duplication. |
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.
Need to resolve this before merge.
switchBd.objfn_builder[d, i] = _objfns.ObjectiveFunctionBuilder.create_from('logl') # est.parameters.get('final_objfn_builder', _objfns.ObjectiveFunctionBuilder.create_from('logl')) | ||
switchBd.objfn_builder_modvi[d, i] = _objfns.ObjectiveFunctionBuilder.create_from('logl') | ||
# est_modvi.parameters.get('final_objfn_builder', _objfns.ObjectiveFunctionBuilder.create_from('logl')) |
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.
Need to explain why these changes were made.
- skip_sections : tuple[str], optional | ||
Contains names of standard report sections that should be skipped | ||
in this particular report. Strings will be cast to lowercase, | ||
stripped of white space, and then mapped to omitted Section classes | ||
as follows | ||
|
||
{ | ||
'summary' : SummarySection, | ||
'goodness' : GoodnessSection, | ||
'colorbox' : GoodnessColorBoxPlotSection, | ||
'invariantgates' : GaugeInvariantsGatesSection, | ||
'invariantgerms' : GaugeInvariantsGermsSection, | ||
'variant' : GaugeVariantSection, | ||
'variantraw' : GaugeVariantsRawSection, | ||
'variantdecomp' : GaugeVariantsDecompSection, | ||
'varianterrorgen' : GaugeVariantsErrorGenSection, | ||
'input' : InputSection, | ||
'meta' : MetaSection, | ||
'help' : HelpSection | ||
} | ||
|
||
A KeyError will be raised if skip_sections contains a string | ||
that is not in the keys of the above dict (after casting to | ||
lower case and stripping white space). | ||
|
||
|
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.
This can be moved to another PR, along with the changes below.
I noticed there's a total variance distance objective function class which is almost finished. The only missing functions for the code to run without formally raising an error were
RawTVDFunction.dterms
andRawTVDFunction.chi2k_distributed_qty
. The former function has a very simple "canonical" implementation, but it's numerically problematic since the 1-norm isn't differentiable at any vector with a zero component. I don't know what a mathematically correct version of the second function looks like (or if there is such an implementation) so I just have it return -1 to indicate "this doesn't mean what you think it means."I'm mostly opening this PR to facilitate QPL-internal discussion on the topic.
You can run GST where the final iteration is TVD-based instead of log-likelihood using something like the following.