-
Notifications
You must be signed in to change notification settings - Fork 12
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
Override defaults for link functions #320
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.
General comment:
- we should probably rename the
default
argument towardsprior_settings
or something like that.
Otherwise looks good, apart from the pytensor operations for the link functions.
|
||
self.bounds = bounds | ||
|
||
def _make_generalized_sigmoid_simple(self, a, b): |
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.
I think you want to use pytensor operations here no?
At least the linkinv_backend should be pytensor, the others are prob ok.
The example I gave had all pytensor? I think so. (So all pytensor should work either way, since I tested that)
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.
Actually bambi
uses numpy
functions, so I just want to make it consistent with other link functions in bambi. https://github.com/bambinos/bambi/blob/main/bambi/families/link.py
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.
kind of confusing because in the docs for Link it says:
'''
linkinv_backend : function
Same than linkinv
but must be something that works with PyMC backend (i.e. it must
work with PyTensor tensors). Does not need to be specified when name
is a known
name.
'''
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.
do numpy --> pt happen automatically?
because without pt it's not going to be differentiable...
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.
I wouldn't worry too much about this. I basically copied the docs from Bambi, and numpy should be compatible with pytensor. Also, we are not touching linkinv_backend
here. Actually none of the bambi-defined link functions uses link_backend
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.
do numpy --> pt happen automatically? because without pt it's not going to be differentiable...
I think there's some interpretability between numpy and pytensor. Otherwise none of the bambi link functions would work
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.
ok!
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.
I think all conversations are resolved?
Approved.
Updates in this PR:
override_default_link
method tohssm.Param
classoverride_default_link
method is called on eachParam
before each Param is finalizeddefault
parameter to hssm.HSSM to control which override strategy to use