@@ -158,7 +158,6 @@ function mcmcsample(
158
158
elseif progress === false
159
159
progress = NoLogging ()
160
160
end
161
- init_progress (progress)
162
161
163
162
# Determine how many samples to drop from `num_warmup` and the
164
163
# main sampling process before we start saving samples.
@@ -170,6 +169,7 @@ function mcmcsample(
170
169
local state
171
170
172
171
@withprogresslogger begin
172
+ init_progress (progress)
173
173
# Determine threshold values for progress logging
174
174
# (one update per 0.5% of progress)
175
175
n_updates = progress isa ChannelProgress ? progress. n_updates : 200
@@ -310,7 +310,6 @@ function mcmcsample(
310
310
elseif progress === false
311
311
progress = NoLogging ()
312
312
end
313
- init_progress (progress)
314
313
315
314
# Determine how many samples to drop from `num_warmup` and the
316
315
# main sampling process before we start saving samples.
@@ -322,6 +321,7 @@ function mcmcsample(
322
321
local state
323
322
324
323
@withprogresslogger begin
324
+ init_progress (progress)
325
325
# Obtain the initial sample and state.
326
326
sample, state = if num_warmup > 0
327
327
if initial_state === nothing
@@ -384,10 +384,10 @@ function mcmcsample(
384
384
# Increment iteration counter.
385
385
i += 1
386
386
end
387
+ finish_progress (progress)
387
388
end
388
389
389
390
# Get the sample stop time.
390
- finish_progress (progress)
391
391
stop = time ()
392
392
duration = stop - start
393
393
stats = SamplingStats (start, stop, duration)
0 commit comments