Closed joergfunger closed 3 years ago
I mostly dealt with VB, so the VariationalBayesProblem, where the prior defines the start values, see e.g. here. The same should generally be true for Bayesian problems. So, technically, this start_vector
is only present in a deterministic inference, right?
The LatentParameters
is really just a mapping for multiple parameter lists to a global name, b
in your example. So a latent['b'].set_value(...)
would rather update all the individual parameter lists linked to that b
(and not fill a start_vector
).
So maybe you could first clarify, what you intend to do.
The start vector is (as you pointed out) for a deterministed problem. But it might also be relevant for testing, where you want to evaluate the model error for a specific set of parameters in the global problem. I agree that the set function would just set all values, we would probably have an extract function again. Or a function that somehow generates the global startvector
startvector = inference_problem.start_vector({'b':0, 'a':100})
The not defined variables will be extracted from the first parameter list that has this entry.
Except for VB (which is part of the lib itself), we decided to not have code to define an algorithm/tool specific prior. So if we interpret the start_vector
as the prior of a deterministic inference, we should not have something like this. But this is really silly and, as you pointed out, also nice for testing.
And I like your code idea! As we strive for total clarity and unambiguousness, I would raise an exception like:
Global parameter "c" has value 42 in listA and value 6174 in listB [and I do not know which one to choose]. Please specify it in the argument dict.
The exception is even better in case there is some discrepancies.
How would the init function for the parameter vector look like? Currently, I do
Should we have a set function?