-
Notifications
You must be signed in to change notification settings - Fork 47
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 kernel translation #311
Conversation
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.
Hi @AVHopp, @Scienfitz, here a few open issues we might want to discuss.
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.
Minor comments. Will properly review in the following week. In any csae, kudos for spotting and fixing.
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.
Looks very nice, have some questions about why some things are necessary/whether I understand them correctly.
Explicit errors are now thrown when attributes cannot be matched
This PR fixes one of the two issues that caused transfer learning performance to deteriorate, fixing several other issues along the way.
Bug fixes
to_gpytorch
(e.g.ard_num_dims
) were not passed on to the GPyTorch kernel class.to_gpytorch
call was not tested and did in fact not succeed in all cases. Causing issues:The torch dtype was not correctly set when translating priors to GPyTorch. --> fixed using temporary workaround (see below)Added workaroundsA proper solution to setting the default torch dtype requires overriding the torch import mechanism usingimportlib
s machinery, due to lazy loading. A preliminary workaround is added in form of theset_default_torch_dtype
utility, which manages the temporary code in a single place.Improvements
match_attributes
utility, which replacesfilter_attributes
now raises an error when attributes cannot be matched to the target callable, instead of silently dropping them. Instrict=False
mode, the unmatched arguments can be inspected as second return value for further processing.