@@ -34,7 +34,7 @@ The arguments of the forward pass are:
34
34
35
35
# Examples
36
36
37
- ```jldoctest
37
+ ```julia
38
38
r = RNNCell(3 => 5)
39
39
40
40
# A sequence of length 10 and batch size 4
@@ -142,7 +142,7 @@ julia> y = rnn(x, h); # [y] = [d_out, len, batch_size]
142
142
Sometimes, the initial hidden state is a learnable parameter.
143
143
In this case, the `RNN` should be wrapped in a custom struct.
144
144
145
- ```jldoctest
145
+ ```julia
146
146
struct Model
147
147
rnn::RNN
148
148
h0::AbstractVector
@@ -317,7 +317,7 @@ in tensors of size `out x len` or `out x len x batch_size`.
317
317
318
318
# Examples
319
319
320
- ```jldoctest
320
+ ```julia
321
321
struct Model
322
322
lstm::LSTM
323
323
h0::AbstractVector
@@ -404,10 +404,9 @@ Returns the new hidden state `h'` as an array of size `out` or `out x batch_size
404
404
405
405
# Examples
406
406
407
- TODO add loop
408
407
```jldoctest
409
408
julia> g = GRUCell(3 => 5)
410
- GRUCell(3 => 5) # 140 parameters
409
+ GRUCell(3 => 5) # 135 parameters
411
410
412
411
julia> h = zeros(Float32, 5); # hidden state
413
412
@@ -485,7 +484,7 @@ Returns all new hidden states `h_t` as an array of size `out x len x batch_size`
485
484
486
485
# Examples
487
486
488
- ```jldoctest
487
+ ```julia
489
488
d_in, d_out, len, batch_size = 2, 3, 4, 5
490
489
gru = GRU(d_in => d_out)
491
490
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}
615
614
for all `len` steps `t` in the input sequence.
616
615
See [`GRUv3Cell`](@ref) for a layer that processes a single time step.
617
616
See [`GRU`](@ref) and [`GRUCell`](@ref) for variants of this layer.
618
-
619
- # Examples
620
- TODO
621
617
"""
622
618
struct GRUv3{M}
623
619
cell:: M
0 commit comments