Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
CarloLucibello committed Oct 22, 2024
1 parent 7f4e2d9 commit aa0655d
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/layers/recurrent.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The arguments of the forward pass are:
# Examples
```jldoctest
```julia
r = RNNCell(3 => 5)
# A sequence of length 10 and batch size 4
Expand Down Expand Up @@ -142,7 +142,7 @@ julia> y = rnn(x, h); # [y] = [d_out, len, batch_size]
Sometimes, the initial hidden state is a learnable parameter.
In this case, the `RNN` should be wrapped in a custom struct.
```jldoctest
```julia
struct Model
rnn::RNN
h0::AbstractVector
Expand Down Expand Up @@ -317,7 +317,7 @@ in tensors of size `out x len` or `out x len x batch_size`.
# Examples
```jldoctest
```julia
struct Model
lstm::LSTM
h0::AbstractVector
Expand Down Expand Up @@ -404,10 +404,9 @@ Returns the new hidden state `h'` as an array of size `out` or `out x batch_size
# Examples
TODO add loop
```jldoctest
julia> g = GRUCell(3 => 5)
GRUCell(3 => 5) # 140 parameters
GRUCell(3 => 5) # 135 parameters
julia> h = zeros(Float32, 5); # hidden state
Expand Down Expand Up @@ -485,7 +484,7 @@ Returns all new hidden states `h_t` as an array of size `out x len x batch_size`
# Examples
```jldoctest
```julia
d_in, d_out, len, batch_size = 2, 3, 4, 5
gru = GRU(d_in => d_out)
x = rand(Float32, (d_in, len, batch_size))
Expand Down Expand Up @@ -615,9 +614,6 @@ h_t = (1 - z_t) \odot h̃_t + z_t \odot h_{t-1}
for all `len` steps `t` in the input sequence.
See [`GRUv3Cell`](@ref) for a layer that processes a single time step.
See [`GRU`](@ref) and [`GRUCell`](@ref) for variants of this layer.
# Examples
TODO
"""
struct GRUv3{M}
cell::M
Expand Down

0 comments on commit aa0655d

Please sign in to comment.