You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When passing transform=None into constraints, constraints are not enforced via a transform. Yet the parameter initialization in most places sets initial values to zero, disregarding the constraint. E.g. if you pass noise_constraint=GreaterThan(1e-4, transform=None into the GaussianLikelihood, then the initial value of the noise is 0. This usually results in nan errors in the first step of fitting. You can manually set the initial value to something more reasonable, but it's kind of cumbersome to have to do that manually every time when instantiating a model.
Expected Behavior
If a non-enforced constraint is present, the initial value should be chosen in compliance with the constraint in some reasonable fashion, e.g. as the mid point of an Interval constraint, or as 2*lower_bound for a GreaterThan constraint.
The text was updated successfully, but these errors were encountered:
Let's add an inital_value method to constraints and then use it in our modules (e.g. Kernel) after registering? I don't think we should have register_constraint modify parameter values, or it could lead to gotchas if people set custom initial values before registering constraints (a perfectly reasonable workflow if they haven't used the model yet).
Another thing that would make a lot of sense is to initialize parameters from the mean/mode of the prior (if present). Not sure if we should handle this internally though or whether that's sufficiently advanced a use case that it can be done manually.
🐛 Bug
When passing
transform=None
into constraints, constraints are not enforced via a transform. Yet the parameter initialization in most places sets initial values to zero, disregarding the constraint. E.g. if you passnoise_constraint=GreaterThan(1e-4, transform=None
into theGaussianLikelihood
, then the initial value of the noise is 0. This usually results in nan errors in the first step of fitting. You can manually set the initial value to something more reasonable, but it's kind of cumbersome to have to do that manually every time when instantiating a model.Expected Behavior
If a non-enforced constraint is present, the initial value should be chosen in compliance with the constraint in some reasonable fashion, e.g. as the mid point of an
Interval
constraint, or as 2*lower_bound for aGreaterThan
constraint.The text was updated successfully, but these errors were encountered: