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
{{ message }}
Repository navigation
bug: Zero mean function doesn't necessarily return zero after optimising a GP posterior #330
Currently, the Zero mean function doesn't necessarily stay as zero once the posterior model has been optimised. This is because, under the hood, it is modelled using the Constant mean function, with the constant field set to 0. However, the constant field is trainable, and so upon inspecting a GP posterior which has had its hyperparameters optimised, the Zero mean function can in fact be non-zero.
Create a GP model with a Zero mean function prior, and generate an optimised posterior on some data with non-zero mean. Inspecting the posterior model's "prior" mean will reveal that the constant field of the Zero mean function will have changed from 0. This can be seen in the regression notebook.
Feel free to let me know if this behaviour is in fact intended!
changed the title [-]bug: Zero mean function doesn't necessarily remain zero r[/-][+]bug: Zero mean function doesn't necessarily remain zero [/+]on Jul 4, 2023
changed the title [-]bug: Zero mean function doesn't necessarily remain zero [/-][+]bug: Zero mean function doesn't necessarily return zero after optimising a GP posterior[/+]on Jul 4, 2023
Changing param_field's trainable=False, won't fix this issue in general. The constant field really needs to be a static_field as it should never change value under any operations, and we should have an init=False to ensure it does not change value upon initialisation e.g.,
#339 feels slightly similar to this having just put in the request. Parameter (c) defined as a function of a static field which should remain constant, however is being 'trained' (in this case resulting in an invalid Polar GP).
Hi there, I just want to report to you that it seems this issue appeared again with the latest GPJax (0.9.4).
For example, in tutorial regression, the optimized opt_posterior.prior.mean_function.constant.value is non-zero even though the the prior mean is set to meanf = gpx.mean_functions.Zero().
Activity
[-]bug: Zero mean function doesn't necessarily remain zero r[/-][+]bug: Zero mean function doesn't necessarily remain zero [/+][-]bug: Zero mean function doesn't necessarily remain zero [/-][+]bug: Zero mean function doesn't necessarily return zero after optimising a GP posterior[/+]daniel-dodd commentedon Jul 5, 2023
Thanks for spotting this @Thomas-Christie.
Changing
param_field'strainable=False, won't fix this issue in general. Theconstantfield really needs to be astatic_fieldas it should never change value under any operations, and we should have aninit=Falseto ensure it does not change value upon initialisation e.g.,Other options available here too.
Thomas-Christie commentedon Jul 6, 2023
Thanks for the advice @daniel-dodd , I will work on this.
trsav commentedon Jul 30, 2023
#339 feels slightly similar to this having just put in the request. Parameter (
c) defined as a function of a static field which should remain constant, however is being 'trained' (in this case resulting in an invalid Polar GP).Thomas-Christie commentedon Aug 25, 2023
Fixed in #358
chaozg commentedon Mar 24, 2025
Hi there, I just want to report to you that it seems this issue appeared again with the latest GPJax (0.9.4).
For example, in tutorial regression, the optimized
opt_posterior.prior.mean_function.constant.valueis non-zero even though the the prior mean is set tomeanf = gpx.mean_functions.Zero().Thomas-Christie commentedon Mar 28, 2025
Thanks for pointing this out @chaozg - I've created #499 to track this.
fix(mean-functions): keep the Zero mean at zero during fitting (#713)