Skip to content

Commit ab2df32

Browse files
committed
improve some docs
1 parent 18d2b97 commit ab2df32

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/samplers.jl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ end
1212

1313
"""
1414
BatchSampler{names}(;batch_size, rng=Random.GLOBAL_RNG, transformer=identity)
15+
BatchSampler{names}(batch_size ;rng=Random.GLOBAL_RNG, transformer=identity)
1516
16-
Uniformly sample a batch of examples for each trace specified in `names`. By default, all the traces will be sampled.
17+
Uniformly sample a batch of examples for each trace specified in `names`.
18+
By default, all the traces will be sampled.
1719
1820
See also [`sample`](@ref).
1921
"""
@@ -33,12 +35,14 @@ end
3335
"""
3436
MetaSampler(::NamedTuple)
3537
36-
Wraps a NamedTuple containing multiple samplers. When sampled, returns a named tuple with a batch from each sampler.
38+
Wraps a NamedTuple containing multiple samplers. When sampled, returns a named tuple with a
39+
batch from each sampler.
3740
Used internally for algorithms that sample multiple times per epoch.
3841
3942
# Example
40-
43+
```
4144
MetaSampler(policy = BatchSampler(10), critic = BatchSampler(100))
45+
```
4246
"""
4347
struct MetaSampler{names,T} <: AbstractSampler
4448
samplers::NamedTuple{names,T}
@@ -52,11 +56,14 @@ sample(s::MetaSampler, t) = map(x -> sample(x, t), s.samplers)
5256
"""
5357
MultiBatchSampler(sampler, n)
5458
55-
Wraps a sampler. When sampled, will sample n batches using sampler. Useful in combination with MetaSampler to allow different sampling rates between samplers.
59+
Wraps a sampler. When sampled, will sample n batches using sampler. Useful in combination
60+
with MetaSampler to allow different sampling rates between samplers.
5661
5762
# Example
58-
59-
MetaSampler(policy = MultiBatchSampler(BatchSampler(10), 3), critic = MultiBatchSampler(BatchSampler(100), 5))
63+
```
64+
MetaSampler(policy = MultiBatchSampler(BatchSampler(10), 3),
65+
critic = MultiBatchSampler(BatchSampler(100), 5))
66+
```
6067
"""
6168
struct MultiBatchSampler{S<:AbstractSampler} <: AbstractSampler
6269
sampler::S

0 commit comments

Comments
 (0)