Skip to content

Commit

Permalink
Fix clipping in Adam solver (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcu committed Jan 27, 2021
1 parent 531c6df commit 8b30e5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions solvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,13 +490,13 @@ func (s *AdamSolver) Step(model []ValueGrad) (err error) {
l1reg = float32(s.l1reg)
l2reg = float32(s.l2reg)
clip = float32(s.clip)
negClip = float32(s.clip)
negClip = -float32(s.clip)
beta1 = float32(s.beta1)
beta2 = float32(s.beta2)
omβ1 = float32(1) - float32(s.beta1)
omβ2 = float32(1) - float32(s.beta2)
eps = float32(s.eps)
eta = float32(-s.eta)
eta = -float32(s.eta)
onePerBatch = float32(1) / float32(s.batch)
correctionV1 = float32(1) / float32(correction1)
correctionV2 = float32(1) / float32(correction2)
Expand Down

0 comments on commit 8b30e5a

Please sign in to comment.