@@ -47,6 +47,14 @@ function AbstractMCMC.sample(
47
47
callback = nothing ,
48
48
kwargs... ,
49
49
)
50
+ if haskey (kwargs, :nadapts )
51
+ throw (
52
+ ArgumentError (
53
+ " keyword argument `nadapts` is unsupported. Please use `n_adapts` to specify the number of adaptation steps." ,
54
+ ),
55
+ )
56
+ end
57
+
50
58
if callback === nothing
51
59
callback = HMCProgressCallback (N, progress = progress, verbose = verbose)
52
60
progress = false # don't use AMCMC's progress-funtionality
@@ -78,6 +86,13 @@ function AbstractMCMC.sample(
78
86
callback = nothing ,
79
87
kwargs... ,
80
88
)
89
+ if haskey (kwargs, :nadapts )
90
+ throw (
91
+ ArgumentError (
92
+ " keyword argument `nadapts` is unsupported. Please use `n_adapts` to specify the number of adaptation steps." ,
93
+ ),
94
+ )
95
+ end
81
96
82
97
if callback === nothing
83
98
callback = HMCProgressCallback (N, progress = progress, verbose = verbose)
@@ -144,6 +159,14 @@ function AbstractMCMC.step(
144
159
n_adapts:: Int = 0 ,
145
160
kwargs... ,
146
161
)
162
+ if haskey (kwargs, :nadapts )
163
+ throw (
164
+ ArgumentError (
165
+ " keyword argument `nadapts` is unsupported. Please use `n_adapts` to specify the number of adaptation steps." ,
166
+ ),
167
+ )
168
+ end
169
+
147
170
# Compute transition.
148
171
i = state. i + 1
149
172
t_old = state. transition
@@ -200,7 +223,16 @@ function HMCProgressCallback(n_samples; progress = true, verbose = false)
200
223
HMCProgressCallback (pm, progress, verbose, Ref (0 ), Ref (0 ))
201
224
end
202
225
203
- function (cb:: HMCProgressCallback )(rng, model, spl, t, state, i; nadapts = 0 , kwargs... )
226
+ function (cb:: HMCProgressCallback )(
227
+ rng,
228
+ model,
229
+ spl,
230
+ t,
231
+ state,
232
+ i;
233
+ n_adapts:: Int = 0 ,
234
+ kwargs... ,
235
+ )
204
236
progress = cb. progress
205
237
verbose = cb. verbose
206
238
pm = cb. pm
@@ -243,8 +275,8 @@ function (cb::HMCProgressCallback)(rng, model, spl, t, state, i; nadapts = 0, kw
243
275
),
244
276
)
245
277
# Report finish of adapation
246
- elseif verbose && isadapted && i == nadapts
247
- @info " Finished $nadapts adapation steps" adaptor κ. τ. integrator metric
278
+ elseif verbose && isadapted && i == n_adapts
279
+ @info " Finished $(n_adapts) adapation steps" adaptor κ. τ. integrator metric
248
280
end
249
281
end
250
282
0 commit comments