Slight modifications in recurrent docstrings

This commit is contained in:
janEbert 2019-10-24 22:35:59 +02:00
parent 3b913cd501
commit aaa0a82b74

View File

@ -15,7 +15,7 @@ in the background. `cell` should be a model of the form:
For example, here's a recurrent network that keeps a running total of its inputs:
```julia
accum(h, x) = (h+x, x)
accum(h, x) = (h + x, x)
rnn = Flux.Recur(accum, 0)
rnn(2) # 2
rnn(3) # 3
@ -47,9 +47,10 @@ Base.show(io::IO, m::Recur) = print(io, "Recur(", m.cell, ")")
Reset the hidden state of a recurrent layer back to its original value.
Assuming you have a `Recur` layer `rnn`, this is roughly equivalent to
rnn.state = hidden(rnn.cell)
Assuming you have a `Recur` layer `rnn`, this is roughly equivalent to:
```
rnn.state = hidden(rnn.cell)
```
"""
reset!(m::Recur) = (m.state = m.init)
reset!(m) = foreach(reset!, functor(m)[1])