File tree 4 files changed +17
-1
lines changed 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 14
14
fail-fast : false
15
15
matrix :
16
16
package :
17
+ - {user: TuringLang, repo: AdvancedHMC.jl}
17
18
- {user: TuringLang, repo: AdvancedMH.jl}
18
19
- {user: TuringLang, repo: EllipticalSliceSampling.jl}
19
20
- {user: TuringLang, repo: MCMCChains.jl}
Original file line number Diff line number Diff line change @@ -3,12 +3,13 @@ uuid = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
3
3
keywords = [" markov chain monte carlo" , " probablistic programming" ]
4
4
license = " MIT"
5
5
desc = " A lightweight interface for common MCMC methods."
6
- version = " 4.2"
6
+ version = " 4.2.1 "
7
7
8
8
[deps ]
9
9
BangBang = " 198e06fe-97b7-11e9-32a5-e1d131e6ad66"
10
10
ConsoleProgressMonitor = " 88cd18e8-d9cc-4ea6-8889-5259c0d15c8b"
11
11
Distributed = " 8ba89e20-285c-5b6f-9357-94700520ee1b"
12
+ LogDensityProblems = " 6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c"
12
13
Logging = " 56ddb016-857b-54e1-b83d-db4d58db5568"
13
14
LoggingExtras = " e6f89c97-d47a-5376-807f-9c37f3926c36"
14
15
ProgressLogging = " 33c8b6b6-d38a-422a-b730-caa89a2f386c"
@@ -20,6 +21,7 @@ Transducers = "28d57a85-8fef-5791-bfe6-a80928e7c999"
20
21
[compat ]
21
22
BangBang = " 0.3.19"
22
23
ConsoleProgressMonitor = " 0.1"
24
+ LogDensityProblems = " 2"
23
25
LoggingExtras = " 0.4, 0.5"
24
26
ProgressLogging = " 0.1"
25
27
StatsBase = " 0.32, 0.33"
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ module AbstractMCMC
2
2
3
3
using BangBang: BangBang
4
4
using ConsoleProgressMonitor: ConsoleProgressMonitor
5
+ using LogDensityProblems: LogDensityProblems
5
6
using LoggingExtras: LoggingExtras
6
7
using ProgressLogging: ProgressLogging
7
8
using StatsBase: StatsBase
Original file line number Diff line number Diff line change @@ -12,4 +12,16 @@ that the wrapped object implements the LogDensityProblems.jl interface.
12
12
"""
13
13
struct LogDensityModel{L} <: AbstractModel
14
14
logdensity:: L
15
+ function LogDensityModel {L} (logdensity:: L ) where {L}
16
+ if LogDensityProblems. capabilities (logdensity) === nothing
17
+ throw (
18
+ ArgumentError (
19
+ " The log density function does not support the LogDensityProblems.jl interface" ,
20
+ ),
21
+ )
22
+ end
23
+ return new {L} (logdensity)
24
+ end
15
25
end
26
+
27
+ LogDensityModel (logdensity:: L ) where {L} = LogDensityModel {L} (logdensity)
You can’t perform that action at this time.
0 commit comments