Skip to content

Commit 6855840

Browse files
sunxd3torfjelde
andauthored
Apply suggestions from code review
Co-authored-by: Tor Erlend Fjelde <[email protected]>
1 parent 2d0292c commit 6855840

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

src/AbstractMCMC.jl

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,12 @@ The `MCMCSerial` algorithm allows users to sample serially, with no thread or pr
8181
struct MCMCSerial <: AbstractMCMCEnsemble end
8282

8383
"""
84-
getparams(model::AbstractModel, state)
85-
getparams(logdensity, state)
86-
getparams(state)
84+
getparams([model::AbstractModel, ]state)
8785
8886
Retrieve the values of parameters from the sampler's `state` as a `Vector{<:Real}`.
8987
"""
9088
function getparams end
9189

92-
function getparams(logdensity, state)
93-
return getparams(_model(logdensity), state)
94-
end
95-
9690
function getparams(model::AbstractModel, state)
9791
return getparams(state)
9892
end
@@ -111,17 +105,11 @@ Although not enforced, it should hold that `setparams!!(state, getparams(state))
111105
words, the sampler should implement a consistent transformation between its internal representation
112106
and the vector representation of the parameter values.
113107
114-
Sometimes, to maintain the consistency of the log density and parameter values, a `model::AbstractModel`
108+
Sometimes, to maintain the consistency of the log density and parameter values, a `model`
115109
should be provided. This is useful for samplers that need to evaluate the log density at the new parameter values.
116-
If `model` is not an `AbstractMCMC.AbstractModel`, by default, it is assumed to be a log density function following
117-
the `LogDensityProblems.jl` interface, and will be wrapped with [`AbstractMCMC.LogDensityModel`](@ref).
118110
"""
119111
function setparams!! end
120112

121-
function setparams!!(logdensity, state, params)
122-
return setparams!!(_model(logdensity), state, params)
123-
end
124-
125113
function setparams!!(model::AbstractModel, state, params)
126114
return setparams!!(state, params)
127115
end

0 commit comments

Comments
 (0)