Skip to content

Commit

Permalink
Merge pull request #30 from MartinuzziFrancesco/fm/docs
Browse files Browse the repository at this point in the history
Adding interlinks
  • Loading branch information
MartinuzziFrancesco authored Dec 17, 2024
2 parents 2a010ff + 02d5a43 commit 2b043c1
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 41 deletions.
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
RecurrentLayers = "78449bcf-6750-4b78-9e82-63d4a1ccdf8c"
27 changes: 16 additions & 11 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
using RecurrentLayers
using Documenter
using Documenter, DocumenterInterLinks
include("pages.jl")

DocMeta.setdocmeta!(RecurrentLayers, :DocTestSetup, :(using RecurrentLayers); recursive=true)
mathengine = Documenter.MathJax()

links = InterLinks(
"Flux" => "https://fluxml.ai/Flux.jl/stable/",
)

makedocs(;
modules=[RecurrentLayers],
authors="Francesco Martinuzzi",
sitename="RecurrentLayers.jl",
format=Documenter.HTML(;
modules = [RecurrentLayers],
authors = "Francesco Martinuzzi",
sitename = "RecurrentLayers.jl",
format = Documenter.HTML(;
mathengine,
assets = ["assets/favicon.ico"],
canonical="https://MartinuzziFrancesco.github.io/RecurrentLayers.jl",
edit_link="main",
canonical = "https://MartinuzziFrancesco.github.io/RecurrentLayers.jl",
edit_link = "main",
),
pages=pages,
pages = pages,
plugins = [links],
)

deploydocs(;
repo="github.com/MartinuzziFrancesco/RecurrentLayers.jl",
devbranch="main",
push_preview=true,
repo = "github.com/MartinuzziFrancesco/RecurrentLayers.jl",
devbranch = "main",
push_preview = true,
)
12 changes: 8 additions & 4 deletions src/fastrnn_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ h_t &= \alpha \tilde{h}_t + \beta h_{t-1}
or a matrix of size `input_size x batch_size`.
- `state`: The hidden state of the FastRNN. It should be a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- A tuple `(output, state)`, where both elements are given by the updated state `new_state`,
Expand Down Expand Up @@ -122,7 +123,8 @@ h_t &= \alpha \tilde{h}_t + \beta h_{t-1}
or a matrix of size `input_size x len x batch_size`.
- `state`: The hidden state of the FastRNN. If given, it is a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- New hidden states `new_states` as an array of size `hidden_size x len x batch_size`.
Expand Down Expand Up @@ -182,7 +184,8 @@ h_t &= \big((\zeta (1 - z_t) + \nu) \odot \tilde{h}_t\big) + z_t \odot h_{t-1}
or a matrix of size `input_size x batch_size`.
- `state`: The hidden state of the FastGRNN. It should be a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- A tuple `(output, state)`, where both elements are given by the updated state `new_state`,
Expand Down Expand Up @@ -265,7 +268,8 @@ h_t &= \big((\zeta (1 - z_t) + \nu) \odot \tilde{h}_t\big) + z_t \odot h_{t-1}
or a matrix of size `input_size x batch_size`.
- `state`: The hidden state of the FastGRNN. It should be a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- New hidden states `new_states` as an array of size `hidden_size x len x batch_size`.
Expand Down
6 changes: 4 additions & 2 deletions src/indrnn_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ See [`IndRNN`](@ref) for a layer that processes entire sequences.
or a matrix of size `input_size x batch_size`.
- `state`: The hidden state of the IndRNNCell. It should be a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- A tuple `(output, state)`, where both elements are given by the updated state `new_state`,
Expand Down Expand Up @@ -105,7 +106,8 @@ See [`IndRNNCell`](@ref) for a layer that processes a single sequence.
or a matrix of size `input_size x len x batch_size`.
- `state`: The hidden state of the IndRNN. If given, it is a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- New hidden states `new_states` as an array of size `hidden_size x len x batch_size`.
Expand Down
6 changes: 4 additions & 2 deletions src/lightru_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ h_t &= (1 - f_t) \odot h_{t-1} + f_t \odot \tilde{h}_t.
or a matrix of size `input_size x batch_size`.
- `state`: The hidden state of the LightRUCell. It should be a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- A tuple `(output, state)`, where both elements are given by the updated state `new_state`,
Expand Down Expand Up @@ -116,7 +117,8 @@ h_t &= (1 - f_t) \odot h_{t-1} + f_t \odot \tilde{h}_t.
or a matrix of size `input_size x len x batch_size`.
- `state`: The hidden state of the LightRU. If given, it is a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- New hidden states `new_states` as an array of size `hidden_size x len x batch_size`.
Expand Down
6 changes: 4 additions & 2 deletions src/ligru_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ h_t &= z_t \odot h_{t-1} + (1 - z_t) \odot \tilde{h}_t
or a matrix of size `input_size x batch_size`.
- `state`: The hidden state of the LiGRUCell. It should be a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- A tuple `(output, state)`, where both elements are given by the updated state `new_state`,
Expand Down Expand Up @@ -118,7 +119,8 @@ h_t &= z_t \odot h_{t-1} + (1 - z_t) \odot \tilde{h}_t
or a matrix of size `input_size x len x batch_size`.
- `state`: The hidden state of the LiGRU. If given, it is a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- New hidden states `new_states` as an array of size `hidden_size x len x batch_size`.
Expand Down
6 changes: 4 additions & 2 deletions src/mgu_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ h_t &= (1 - f_t) \odot h_{t-1} + f_t \odot \tilde{h}_t
or a matrix of size `input_size x batch_size`.
- `state`: The hidden state of the MGUCell. It should be a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- A tuple `(output, state)`, where both elements are given by the updated state `new_state`,
Expand Down Expand Up @@ -115,7 +116,8 @@ h_t &= (1 - f_t) \odot h_{t-1} + f_t \odot \tilde{h}_t
or a matrix of size `input_size x len x batch_size`.
- `state`: The hidden state of the MGU. If given, it is a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- New hidden states `new_states` as an array of size `hidden_size x len x batch_size`.
Expand Down
18 changes: 12 additions & 6 deletions src/mut_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ h_{t+1} &= \tanh(U_h (r \odot h_t) + \tanh(W_h x_t) + b_h) \odot z \\
or a matrix of size `input_size x batch_size`.
- `state`: The hidden state of the MUTCell. It should be a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- A tuple `(output, state)`, where both elements are given by the updated state `new_state`,
Expand Down Expand Up @@ -119,7 +120,8 @@ h_{t+1} &= \tanh(U_h (r \odot h_t) + \tanh(W_h x_t) + b_h) \odot z \\
or a matrix of size `input_size x len x batch_size`.
- `state`: The hidden state of the MUT. If given, it is a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- New hidden states `new_states` as an array of size `hidden_size x len x batch_size`.
Expand Down Expand Up @@ -174,7 +176,8 @@ h_{t+1} &= \tanh(U_h (r \odot h_t) + W_h x_t + b_h) \odot z \\
or a matrix of size `input_size x batch_size`.
- `state`: The hidden state of the MUTCell. It should be a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- A tuple `(output, state)`, where both elements are given by the updated state `new_state`,
Expand Down Expand Up @@ -250,7 +253,8 @@ h_{t+1} &= \tanh(U_h (r \odot h_t) + W_h x_t + b_h) \odot z \\
or a matrix of size `input_size x len x batch_size`.
- `state`: The hidden state of the MUT. If given, it is a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- New hidden states `new_states` as an array of size `hidden_size x len x batch_size`.
Expand Down Expand Up @@ -305,7 +309,8 @@ h_{t+1} &= \tanh(U_h (r \odot h_t) + W_h x_t + b_h) \odot z \\
or a matrix of size `input_size x batch_size`.
- `state`: The hidden state of the MUTCell. It should be a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- A tuple `(output, state)`, where both elements are given by the updated state `new_state`,
Expand Down Expand Up @@ -379,7 +384,8 @@ h_{t+1} &= \tanh(U_h (r \odot h_t) + W_h x_t + b_h) \odot z \\
or a matrix of size `input_size x len x batch_size`.
- `state`: The hidden state of the MUT. If given, it is a vector of size
`hidden_size` or a matrix of size `hidden_size x batch_size`.
If not provided, it is assumed to be a vector of zeros.
If not provided, it is assumed to be a vector of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- New hidden states `new_states` as an array of size `hidden_size x len x batch_size`.
Expand Down
8 changes: 5 additions & 3 deletions src/nas_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ h_{\text{new}} &= \tanh(c_{\text{new}} \cdot l_5)
or a matrix of size `input_size x batch_size`.
- `(state, cstate)`: A tuple containing the hidden and cell states of the NASCell.
They should be vectors of size `hidden_size` or matrices of size `hidden_size x batch_size`.
If not provided, they are assumed to be vectors of zeros.
If not provided, they are assumed to be vectors of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- A tuple `(output, state)`, where `output = new_state` is the new hidden state and
Expand Down Expand Up @@ -202,8 +203,9 @@ h_{\text{new}} &= \tanh(c_{\text{new}} \cdot l_5)
- `inp`: The input to the nas. It should be a vector of size `input_size x len`
or a matrix of size `input_size x len x batch_size`.
- `(state, cstate)`: A tuple containing the hidden and cell states of the NAS.
They should be vectors of size `hidden_size` or matrices of size `hidden_size x batch_size`.
If not provided, they are assumed to be vectors of zeros
They should be vectors of size `hidden_size` or matrices of size `hidden_size x batch_size`.
If not provided, they are assumed to be vectors of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- New hidden states `new_states` as an array of size `hidden_size x len x batch_size`.
Expand Down
8 changes: 5 additions & 3 deletions src/peepholelstm_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ h_t &= o_t \odot \sigma_h(c_t).
or a matrix of size `input_size x batch_size`.
- `(state, cstate)`: A tuple containing the hidden and cell states of the PeepholeLSTMCell.
They should be vectors of size `hidden_size` or matrices of size `hidden_size x batch_size`.
If not provided, they are assumed to be vectors of zeros.
If not provided, they are assumed to be vectors of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- A tuple `(output, state)`, where `output = new_state` is the new hidden state and
Expand Down Expand Up @@ -120,8 +121,9 @@ h_t &= o_t \odot \sigma_h(c_t).
- `inp`: The input to the peepholelstm. It should be a vector of size `input_size x len`
or a matrix of size `input_size x len x batch_size`.
- `(state, cstate)`: A tuple containing the hidden and cell states of the PeepholeLSTM.
They should be vectors of size `hidden_size` or matrices of size `hidden_size x batch_size`.
If not provided, they are assumed to be vectors of zeros
They should be vectors of size `hidden_size` or matrices of size `hidden_size x batch_size`.
If not provided, they are assumed to be vectors of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- New hidden states `new_states` as an array of size `hidden_size x len x batch_size`.
Expand Down
8 changes: 5 additions & 3 deletions src/ran_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ h_t &= g(c_t)
or a matrix of size `input_size x batch_size`.
- `(state, cstate)`: A tuple containing the hidden and cell states of the RANCell.
They should be vectors of size `hidden_size` or matrices of size `hidden_size x batch_size`.
If not provided, they are assumed to be vectors of zeros.
If not provided, they are assumed to be vectors of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- A tuple `(output, state)`, where `output = new_state` is the new hidden state and
Expand Down Expand Up @@ -128,8 +129,9 @@ h_t &= g(c_t)
- `inp`: The input to the ran. It should be a vector of size `input_size x len`
or a matrix of size `input_size x len x batch_size`.
- `(state, cstate)`: A tuple containing the hidden and cell states of the RAN.
They should be vectors of size `hidden_size` or matrices of size `hidden_size x batch_size`.
If not provided, they are assumed to be vectors of zeros
They should be vectors of size `hidden_size` or matrices of size `hidden_size x batch_size`.
If not provided, they are assumed to be vectors of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- New hidden states `new_states` as an array of size `hidden_size x len x batch_size`.
Expand Down
8 changes: 5 additions & 3 deletions src/scrn_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ y_t &= f(U_y h_t + W_y s_t)
or a matrix of size `input_size x batch_size`.
- `(state, cstate)`: A tuple containing the hidden and cell states of the SCRNCell.
They should be vectors of size `hidden_size` or matrices of size `hidden_size x batch_size`.
If not provided, they are assumed to be vectors of zeros.
If not provided, they are assumed to be vectors of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- A tuple `(output, state)`, where `output = new_state` is the new hidden state and
Expand Down Expand Up @@ -130,8 +131,9 @@ y_t &= f(U_y h_t + W_y s_t)
- `inp`: The input to the scrn. It should be a vector of size `input_size x len`
or a matrix of size `input_size x len x batch_size`.
- `(state, cstate)`: A tuple containing the hidden and cell states of the SCRN.
They should be vectors of size `hidden_size` or matrices of size `hidden_size x batch_size`.
If not provided, they are assumed to be vectors of zeros
They should be vectors of size `hidden_size` or matrices of size `hidden_size x batch_size`.
If not provided, they are assumed to be vectors of zeros,
initialized by [`Flux.initialstates`](@extref).
## Returns
- New hidden states `new_states` as an array of size `hidden_size x len x batch_size`.
Expand Down

0 comments on commit 2b043c1

Please sign in to comment.