Skip to content

Commit 4fb5dec

Browse files
update docs
1 parent 08226a4 commit 4fb5dec

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ cv_data, test_data = splitobs((Xs, Ys); at=0.85)
4343

4444
# Next we partition the data using a 10-fold scheme.
4545
for (train_data, val_data) in kfolds(cv_data; k=10)
46-
for epoch = 1:100
46+
47+
# We apply a lazy transform for data augmentation
48+
train_data = mapobs(xy -> (xy[1] .+ 0.1 .* randn.(), xy[2]), train_data)
49+
50+
for epoch = 1:10
4751
# Iterate over the data using mini-batches of 5 observations each
4852
for (x, y) in eachobs(train_data, batchsize=5)
4953
# ... train supervised model on minibatches here

src/obstransform.jl

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ Indexing triggers the transformation `f`.
3737
The batched keyword argument controls the behavior of `mdata[idx]` and `mdata[idxs]`
3838
where `idx` is an integer and `idxs` is a vector of integers:
3939
- `batched=:auto` (default). Let `f` handle the two cases.
40-
Call `f(getobs(data, idx))` and `f(getobs(data, idxs))`.
41-
- `batched=:never`. `f` is always called on a single observation.
42-
Call `f(getobs(data, idx))` and `[f(getobs(data, idx)) for idx in idxs]`.
43-
- `batched=:always`. `f` is always called on a batch of observations.
44-
Call `getobs(f(getobs(data, [idx])), 1)` and `f(getobs(data, idxs))`.
40+
Calls `f(getobs(data, idx))` and `f(getobs(data, idxs))`.
41+
- `batched=:never`. The function `f` is always called on a single observation.
42+
Calls `f(getobs(data, idx))` and `[f(getobs(data, idx)) for idx in idxs]`.
43+
- `batched=:always`. The function `f` is always called on a batch of observations.
44+
Calls `getobs(f(getobs(data, [idx])), 1)` and `f(getobs(data, idxs))`.
4545
4646
# Examples
4747

0 commit comments

Comments
 (0)