From d6a1ccd354b3c695811c3406efe5ae65e20cdfdc Mon Sep 17 00:00:00 2001 From: Dhairya Gandhi Date: Sun, 3 May 2020 16:56:39 +0530 Subject: [PATCH] add correct overload for apply in docs --- docs/src/training/optimisers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/training/optimisers.md b/docs/src/training/optimisers.md index 5ed083ee..1334f07d 100644 --- a/docs/src/training/optimisers.md +++ b/docs/src/training/optimisers.md @@ -80,7 +80,7 @@ Momentum(eta::Real, rho::Real) = Momentum(eta, rho, IdDict()) The `Momentum` type will act as our optimiser in this case. Notice that we have added all the parameters as fields, along with the velocity which we will use as our state dictionary. Each parameter in our models will get an entry in there. We can now define the rule applied when this optimiser is invoked. ```julia -function apply!(o::Momentum, x, Δ) +function Flux.Optimise.apply!(o::Momentum, x, Δ) η, ρ = o.eta, o.rho v = get!(o.velocity, x, zero(x))::typeof(x) @. v = ρ * v - η * Δ