Zero source rj#14
Conversation
Signed-off-by: code_reformat <>
…into zero_source_rj
mattj89
left a comment
There was a problem hiding this comment.
Some docstring updates. I don't understand a lot of the code changes (e.g. returning the allocation matrix as a parameter vector from the MixtureParameter cases). Let's discuss next week.
| parameters that need to be created/removed as part of the dimension change. The default behaviour is to | ||
| sample the necessary additional values from the associated parameter prior distribution. Defaults to None. | ||
| n_max (int): upper limit on self.param (lower limit is assumed to be 1). | ||
| n_max (int): upper limit on self.param. |
There was a problem hiding this comment.
Added this for completeness but the fact is pretty much every input to RJ has None as default but is in actual fact required to make it run.
| """ | ||
| return sparse.diags(diagonals=state[self.param][state[self.allocation]].flatten(), offsets=0, format="csc") | ||
| if state[self.param].shape[0] == 0: | ||
| diagonals = state[self.allocation].flatten() |
There was a problem hiding this comment.
I think that self.allocation is an allocation index (i.e. index vector which determines the allocation of each element of the data to e.g. a kernel). I don't think this should just go on the diagonal of a precision matrix? Totally different to the functionality which is in the other case statement?
There was a problem hiding this comment.
have updated to zeros and looked at cases where this is used and it is not used anywhere but the unit tests
|
|
||
| """ | ||
| if state[self.param].shape[0] == 0: | ||
| return state[self.allocation] |
There was a problem hiding this comment.
As with the matrix case (lines 503-508), why would just just set the predictor to be the allocation vector?
There was a problem hiding this comment.
have updated to zeros and looked at cases where this is used and it is not used anywhere but the unit tests
There was a problem hiding this comment.
Not looked at tests yet- will do so once we've had chance to discuss the above issues.
There was a problem hiding this comment.
Not looked at tests yet- will do so once we've had chance to discuss the above issues.
Signed-off-by: code_reformat <>
Description
Extend reversible jump code to handle reversible jump cases with no components.
Type of change
Please delete options that are not relevant.
Jupyter Notebooks
No changes to existing notebooks
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration
Checklist: