Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've thought a bit more about
transition_type
, and how to improve on what I mentioned in #9 (comment).In this PR I propose the following changes:
transition_type
and instead just obtain the first transitiontransitions_init
, whose default implementation just creates a vector forN
transitions of the type of the initial transitiontransitions_save!
to which (among others) the transitions container, the current iteration, and the current transition is passed; the default implementation for vector-type containers just saves the current transition in the containerAbstractTransition
The main advantages with this approach are:
transition_type
- as long as theirstep!
implementation is type stable it just worksAbstractTransition
subtype anymore - ifstep!
just returns a parameter vector or a named tuple, the default implementation ofsample
will just yield a vector of parameter vectors or named tuplessample_init!
orsample_end!
(which many people do not want to call directly and have to be imported anyway if implemented for specific types). In general, I think in every concrete implementation of AbstractModel/AbstractSampler one just has to decide which methods of AbstractMCMC to export (probably justsample
andpsample
).