Skip to content

Commit 562be62

Browse files
committed
tweak the doc example
1 parent e3ca35e commit 562be62

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/src/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,14 @@ opt = Optimisers.setup(Optimisers.Momentum(), net);
155155

156156
net.layers[3] isa Dense # now freeze this layer's parameters:
157157
Optimisers.freeze!(opt.layers[3])
158+
opt.layers[3].bias # confirm: Leaf(Momentum(...), [0.0, 0.0], frozen = true)
158159

159160
Optimisers.update!(opt, net, gradient(m -> sum(m(x)), net)...);
160161

161-
net.layers[3].bias # stil zero, and its momentum is zero too:
162-
opt # bias = Leaf(Momentum{Float32}(0.01, 0.9), Float32[0.0, 0.0], frozen = true)
162+
net.layers[3].bias # stil zero, and its momentum is too:
163163

164164
Optimisers.thaw!(opt)
165+
opt.layers[3].bias # Leaf(Momentum(...), [0.0, 0.0])
165166
```
166167

167168
## Tied Parameters

0 commit comments

Comments
 (0)