Skip to content

Commit 76cf275

Browse files
fix docs
1 parent 5629e17 commit 76cf275

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/layers/recurrent.jl

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The arguments of the forward pass are:
3434
3535
# Examples
3636
37-
```jldoctest
37+
```julia
3838
r = RNNCell(3 => 5)
3939
4040
# A sequence of length 10 and batch size 4
@@ -142,7 +142,7 @@ julia> y = rnn(x, h); # [y] = [d_out, len, batch_size]
142142
Sometimes, the initial hidden state is a learnable parameter.
143143
In this case, the `RNN` should be wrapped in a custom struct.
144144
145-
```jldoctest
145+
```julia
146146
struct Model
147147
rnn::RNN
148148
h0::AbstractVector
@@ -317,7 +317,7 @@ in tensors of size `out x len` or `out x len x batch_size`.
317317
318318
# Examples
319319
320-
```jldoctest
320+
```julia
321321
struct Model
322322
lstm::LSTM
323323
h0::AbstractVector
@@ -404,10 +404,9 @@ Returns the new hidden state `h'` as an array of size `out` or `out x batch_size
404404
405405
# Examples
406406
407-
TODO add loop
408407
```jldoctest
409408
julia> g = GRUCell(3 => 5)
410-
GRUCell(3 => 5) # 140 parameters
409+
GRUCell(3 => 5) # 135 parameters
411410
412411
julia> h = zeros(Float32, 5); # hidden state
413412
@@ -485,7 +484,7 @@ Returns all new hidden states `h_t` as an array of size `out x len x batch_size`
485484
486485
# Examples
487486
488-
```jldoctest
487+
```julia
489488
d_in, d_out, len, batch_size = 2, 3, 4, 5
490489
gru = GRU(d_in => d_out)
491490
x = rand(Float32, (d_in, len, batch_size))
@@ -615,9 +614,6 @@ h_t = (1 - z_t) \odot h̃_t + z_t \odot h_{t-1}
615614
for all `len` steps `t` in the input sequence.
616615
See [`GRUv3Cell`](@ref) for a layer that processes a single time step.
617616
See [`GRU`](@ref) and [`GRUCell`](@ref) for variants of this layer.
618-
619-
# Examples
620-
TODO
621617
"""
622618
struct GRUv3{M}
623619
cell::M

0 commit comments

Comments
 (0)