Skip to content

Commit

Permalink
Merge a4d2f5d into 467b076
Browse files Browse the repository at this point in the history
  • Loading branch information
sunxd3 authored Oct 23, 2024
2 parents 467b076 + a4d2f5d commit ac2d9c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ uuid = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
keywords = ["markov chain monte carlo", "probabilistic programming"]
license = "MIT"
desc = "A lightweight interface for common MCMC methods."
version = "5.5.0"
version = "5.5.1"

[deps]
BangBang = "198e06fe-97b7-11e9-32a5-e1d131e6ad66"
Expand Down
12 changes: 8 additions & 4 deletions src/AbstractMCMC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,27 @@ The `MCMCSerial` algorithm allows users to sample serially, with no thread or pr
struct MCMCSerial <: AbstractMCMCEnsemble end

"""
getparams(state[; kwargs...])
getparams(state[, logdensity_function])
Retrieve the values of parameters from the sampler's `state` as a `Vector{<:Real}`.
"""
function getparams end

"""
setparams!!(state, params)
setparams!!(state, params[, logdensity_function])
Set the values of parameters in the sampler's `state` from a `Vector{<:Real}`.
This function should follow the `BangBang` interface: mutate `state` in-place if possible and
return the mutated `state`. Otherwise, it should return a new `state` containing the updated parameters.
Although not enforced, it should hold that `setparams!!(state, getparams(state)) == state`. In another
word, the sampler should implement a consistent transformation between its internal representation
Although not enforced, it should hold that `setparams!!(state, getparams(state)) == state`. In other
words, the sampler should implement a consistent transformation between its internal representation
and the vector representation of the parameter values.
Sometimes, to maintain the consistency of the log density and parameter values, an optional
`logdensity_function` can be provided. This is useful for samplers that need to evaluate the
log density at the new parameter values.
"""
function setparams!! end

Expand Down

0 comments on commit ac2d9c5

Please sign in to comment.