Skip to content

Commit 952c4a5

Browse files
authored
Merge pull request #1996 from Karthik-d-k/namecase
replace ADAM with Adam and its variants thereof
2 parents 0b01b77 + 7640149 commit 952c4a5

File tree

8 files changed

+92
-83
lines changed

8 files changed

+92
-83
lines changed

docs/src/models/recurrence.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ Flux.reset!(m)
173173
[m(x) for x in seq_init]
174174

175175
ps = Flux.params(m)
176-
opt= ADAM(1e-3)
176+
opt= Adam(1e-3)
177177
Flux.train!(loss, ps, data, opt)
178178
```
179179

docs/src/saving.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,6 @@ You can store the optimiser state alongside the model, to resume training
135135
exactly where you left off. BSON is smart enough to [cache values](https://github.com/JuliaIO/BSON.jl/blob/v0.3.4/src/write.jl#L71) and insert links when saving, but only if it knows everything to be saved up front. Thus models and optimizers must be saved together to have the latter work after restoring.
136136

137137
```julia
138-
opt = ADAM()
138+
opt = Adam()
139139
@save "model-$(now()).bson" model opt
140140
```

docs/src/training/optimisers.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ for p in (W, b)
3939
end
4040
```
4141

42-
An optimiser `update!` accepts a parameter and a gradient, and updates the parameter according to the chosen rule. We can also pass `opt` to our [training loop](training.md), which will update all parameters of the model in a loop. However, we can now easily replace `Descent` with a more advanced optimiser such as `ADAM`.
42+
An optimiser `update!` accepts a parameter and a gradient, and updates the parameter according to the chosen rule. We can also pass `opt` to our [training loop](training.md), which will update all parameters of the model in a loop. However, we can now easily replace `Descent` with a more advanced optimiser such as `Adam`.
4343

4444
## Optimiser Reference
4545

@@ -51,15 +51,15 @@ Descent
5151
Momentum
5252
Nesterov
5353
RMSProp
54-
ADAM
55-
RADAM
54+
Adam
55+
RAdam
5656
AdaMax
57-
ADAGrad
58-
ADADelta
57+
AdaGrad
58+
AdaDelta
5959
AMSGrad
60-
NADAM
61-
ADAMW
62-
OADAM
60+
NAdam
61+
AdamW
62+
OAdam
6363
AdaBelief
6464
```
6565

@@ -182,7 +182,7 @@ WeightDecay
182182
Gradient clipping is useful for training recurrent neural networks, which have a tendency to suffer from the exploding gradient problem. An example usage is
183183

184184
```julia
185-
opt = Optimiser(ClipValue(1e-3), ADAM(1e-3))
185+
opt = Optimiser(ClipValue(1e-3), Adam(1e-3))
186186
```
187187

188188
```@docs

src/Flux.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ include("optimise/Optimise.jl")
2929
using .Optimise
3030
using .Optimise: @epochs
3131
using .Optimise: skip
32-
export Descent, ADAM, Momentum, Nesterov, RMSProp,
33-
ADAGrad, AdaMax, ADADelta, AMSGrad, NADAM, OADAM,
34-
ADAMW, RADAM, AdaBelief, InvDecay, ExpDecay,
32+
export Descent, Adam, Momentum, Nesterov, RMSProp,
33+
AdaGrad, AdaMax, AdaDelta, AMSGrad, NAdam, OAdam,
34+
AdamW, RAdam, AdaBelief, InvDecay, ExpDecay,
3535
WeightDecay, ClipValue, ClipNorm
3636

3737
using CUDA

src/deprecations.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,12 @@ LSTMCell(in::Integer, out::Integer; kw...) = LSTMCell(in => out; kw...)
7171

7272
GRUCell(in::Integer, out::Integer; kw...) = GRUCell(in => out; kw...)
7373
GRUv3Cell(in::Integer, out::Integer; kw...) = GRUv3Cell(in => out; kw...)
74+
75+
# Optimisers with old naming convention
76+
Base.@deprecate_binding ADAM Adam
77+
Base.@deprecate_binding NADAM NAdam
78+
Base.@deprecate_binding ADAMW AdamW
79+
Base.@deprecate_binding RADAM RAdam
80+
Base.@deprecate_binding OADAM OAdam
81+
Base.@deprecate_binding ADAGrad AdaGrad
82+
Base.@deprecate_binding ADADelta AdaDelta

src/optimise/Optimise.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ using LinearAlgebra
44
import ArrayInterface
55

66
export train!, update!,
7-
Descent, ADAM, Momentum, Nesterov, RMSProp,
8-
ADAGrad, AdaMax, ADADelta, AMSGrad, NADAM, ADAMW,RADAM, OADAM, AdaBelief,
7+
Descent, Adam, Momentum, Nesterov, RMSProp,
8+
AdaGrad, AdaMax, AdaDelta, AMSGrad, NAdam, AdamW,RAdam, OAdam, AdaBelief,
99
InvDecay, ExpDecay, WeightDecay, stop, skip, Optimiser,
1010
ClipValue, ClipNorm
1111

0 commit comments

Comments
 (0)