docstring ensure signature code formatting

by using a four space indent instead of two
This commit is contained in:
Martijn Visser 2020-03-01 15:15:39 +01:00
parent 77a7606dad
commit 32e0aa9fcb
5 changed files with 8 additions and 10 deletions

View File

@ -11,7 +11,7 @@ struct DataLoader
end end
""" """
DataLoader(data...; batchsize=1, shuffle=false, partial=true) DataLoader(data...; batchsize=1, shuffle=false, partial=true)
An object that iterates over mini-batches of `data`, each mini-batch containing `batchsize` observations An object that iterates over mini-batches of `data`, each mini-batch containing `batchsize` observations
(except possibly the last one). (except possibly the last one).

View File

@ -28,7 +28,6 @@ function load()
end end
""" """
labels() labels()
Get the labels of the iris dataset, a 150 element array of strings listing the Get the labels of the iris dataset, a 150 element array of strings listing the
@ -53,7 +52,6 @@ function labels()
end end
""" """
features() features()
Get the features of the iris dataset. This is a 4x150 matrix of Float64 Get the features of the iris dataset. This is a 4x150 matrix of Float64

View File

@ -6,7 +6,7 @@ const ϵ = 1e-8
# TODO: should use weak refs # TODO: should use weak refs
""" """
Descent(η) Descent(η)
Classic gradient descent optimiser with learning rate `η`. Classic gradient descent optimiser with learning rate `η`.
For each parameter `p` and its gradient `δp`, this runs `p -= η*δp` For each parameter `p` and its gradient `δp`, this runs `p -= η*δp`
@ -441,7 +441,7 @@ function apply!(o::Optimiser, x, Δ)
end end
""" """
InvDecay(γ) InvDecay(γ)
Applies inverse time decay to an optimiser, i.e., the effective step size at iteration `n` is `eta / (1 + γ * n)` where `eta` is the initial step size. The wrapped optimiser's step size is not modified. Applies inverse time decay to an optimiser, i.e., the effective step size at iteration `n` is `eta / (1 + γ * n)` where `eta` is the initial step size. The wrapped optimiser's step size is not modified.
``` ```
@ -470,7 +470,7 @@ function apply!(o::InvDecay, x, Δ)
end end
""" """
ExpDecay(eta, decay, decay_step, clip) ExpDecay(eta, decay, decay_step, clip)
Discount the learning rate `eta` by a multiplicative factor `decay` every `decay_step` till a minimum of `clip`. Discount the learning rate `eta` by a multiplicative factor `decay` every `decay_step` till a minimum of `clip`.
@ -509,7 +509,7 @@ function apply!(o::ExpDecay, x, Δ)
end end
""" """
WeightDecay(wd) WeightDecay(wd)
Decays the weight by `wd` Decays the weight by `wd`

View File

@ -3,8 +3,8 @@ import Zygote: Params, gradient
""" """
update!(opt, p, g) update!(opt, p, g)
update!(opt, ps::Params, gs) update!(opt, ps::Params, gs)
Perform an update step of the parameters `ps` (or the single parameter `p`) Perform an update step of the parameters `ps` (or the single parameter `p`)
according to optimizer `opt` and the gradients `gs` (the gradient `g`). according to optimizer `opt` and the gradients `gs` (the gradient `g`).

View File

@ -60,7 +60,7 @@ head(x::Tuple) = reverse(Base.tail(reverse(x)))
squeezebatch(x) = reshape(x, head(size(x))) squeezebatch(x) = reshape(x, head(size(x)))
""" """
batch(xs) batch(xs)
Batch the arrays in `xs` into a single array. Batch the arrays in `xs` into a single array.