You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/api.md
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,33 +103,31 @@ For single-chain sampling (i.e., `sample([rng,] model, sampler, N)`), as well as
103
103
104
104
For multiple-chain sampling using `MCMCThreads`, there are several, more detailed, options:
105
105
106
-
-`:perchain`: create one progress bar per chain being sampled, plus one progress bar tracking the number of chains
107
106
-`:overall`: create one progress bar for the overall sampling process, which tracks the percentage of samples that have been sampled across all chains
107
+
-`:perchain`: in addition to `:overall`, also create one progress bar for each individual chain
108
108
-`:none`: do not create any progress bar
109
-
-`true` (the default): use `perchain` for 10 or fewer chains, and `overall` for more than 10 chains
110
-
-`false`: same as `none`, i.e. no progress bar
109
+
-`true` (the default): same as `:overall`, i.e. one progress bar for the overall sampling process
110
+
-`false`: same as `:none`, i.e. no progress bar
111
111
112
112
Multiple-chain sampling using `MCMCDistributed` behaves the same as `MCMCThreads`, except that `:perchain` is not (yet?) implemented.
113
-
So, `true` always corresponds to `:overall`, and `false` corresponds to `:none`.
114
113
115
114
!!! warning "Do not override the `progress` keyword argument"
116
115
If you are implementing your own methods for `sample(...)`, you should make sure to not override the `progress` keyword argument if you want progress logging in multi-chain sampling to work correctly, as the multi-chain `sample()` call makes sure to specifically pass custom values of `progress` to the single-chain calls.
117
116
118
117
### Global settings
119
118
120
-
If you are sampling multiple times and would like to change the default behaviour, you can use these functions to control progress logging globally:
119
+
If you are sampling multiple times and would like to change the default behaviour, you can use this function to control progress logging globally:
121
120
122
121
```@docs
123
122
AbstractMCMC.setprogress!
124
-
AbstractMCMC.setmaxchainsprogress!
125
123
```
126
124
127
125
`setprogress!` is more general, and applies to all types of sampling (both single- and multiple-chain).
128
126
It only takes a boolean argument, which switches progress logging on or off.
129
127
For example, `setprogress!(false)` will disable all progress logging.
130
128
131
-
On the other hand, `setmaxchainsprogress!`is specific to multiple-chain sampling, and allows you to set the threshold for when to switch from `:perchain` to `:overall` progress logging.
132
-
Thus, for example, if you want to keep progress logging on but _always_ want to use `:overall`, you can set `AbstractMCMC.setmaxchainsprogress!(0)`.
129
+
Note that `setprogress!`cannot be used to set the type of progress bar for multiple-chain sampling.
130
+
If you want to use `:perchain`, it has to be set on each individual call to `sample`.
0 commit comments