Skip to content

Commit

Permalink
some more work on docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinuzziFrancesco committed Oct 30, 2024
1 parent be59e51 commit 9047e2c
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 1 deletion.
7 changes: 7 additions & 0 deletions docs/src/api/cells.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@

```@docs
RANCell
IndRNNCell
LightRUCell
LiGRUCell
MGUCell
NASCell
RHNCell
RHNCellUnit
```
5 changes: 5 additions & 0 deletions docs/src/api/wrappers.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@

```@docs
RAN
IndRNN
LightRU
LiGRU
MGU
NAS
```
8 changes: 7 additions & 1 deletion src/indrnn_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ end

Flux.@layer IndRNNCell

"""
IndRNNCell((in, out)::Pair, σ=relu; init = glorot_uniform, bias = true)
"""
function IndRNNCell((in, out)::Pair, σ=relu; init = glorot_uniform, bias = true)
Wi = init(out, in)
u = init(out)
Expand Down Expand Up @@ -38,7 +41,10 @@ struct IndRNN{M}
end

Flux.@layer :expand IndRNN


"""
IndRNN((in, out)::Pair, σ = tanh; bias = true, init = glorot_uniform)
"""
function IndRNN((in, out)::Pair, σ = tanh; bias = true, init = glorot_uniform)
cell = IndRNNCell(in => out, σ; bias=bias, init=init)
return IndRNN(cell)
Expand Down
6 changes: 6 additions & 0 deletions src/lightru_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ end

Flux.@layer LightRUCell

"""
LightRUCell((in, out)::Pair, σ=tanh; init = glorot_uniform, bias = true)
"""
function LightRUCell((in, out)::Pair, σ=tanh; init = glorot_uniform, bias = true)
Wi = init(2 * out, in)
Wh = init(out, out)
Expand Down Expand Up @@ -47,6 +50,9 @@ end

Flux.@layer :expand LightRU

"""
LightRU((in, out)::Pair; init = glorot_uniform, bias = true)
"""
function LightRU((in, out)::Pair; init = glorot_uniform, bias = true)
cell = LightRUCell(in => out; init, bias)
return LightRU(cell)
Expand Down
6 changes: 6 additions & 0 deletions src/ligru_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ end

Flux.@layer LiGRUCell

"""
LiGRUCell((in, out)::Pair; init = glorot_uniform, bias = true)
"""
function LiGRUCell((in, out)::Pair;
init = glorot_uniform,
bias = true)
Expand Down Expand Up @@ -45,6 +48,9 @@ end

Flux.@layer :expand LiGRU

"""
LiGRU((in, out)::Pair; init = glorot_uniform, bias = true)
"""
function LiGRU((in, out)::Pair; init = glorot_uniform, bias = true)
cell = LiGRUCell(in => out; init, bias)
return LiGRU(cell)
Expand Down
6 changes: 6 additions & 0 deletions src/mgu_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ end

Flux.@layer MGUCell

"""
MGUCell((in, out)::Pair; init = glorot_uniform, bias = true)
"""
function MGUCell((in, out)::Pair;
init = glorot_uniform,
bias = true)
Expand Down Expand Up @@ -48,6 +51,9 @@ end

Flux.@layer :expand MGU

"""
MGU((in, out)::Pair; init = glorot_uniform, bias = true)
"""
function MGU((in, out)::Pair; init = glorot_uniform, bias = true)
cell = MGUCell(in => out; init, bias)
return MGU(cell)
Expand Down
6 changes: 6 additions & 0 deletions src/nas_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ end

Flux.@layer NASCell

"""
NASCell((in, out)::Pair; init = glorot_uniform, bias = true)
"""
function NASCell((in, out)::Pair; init = glorot_uniform, bias = true)
Wi = init(8 * out, in)
Wh = init(8 * out, out)
Expand Down Expand Up @@ -90,6 +93,9 @@ end

Flux.@layer :expand NAS

"""
NAS((in, out)::Pair; init = glorot_uniform, bias = true)
"""
function NAS((in, out)::Pair; init = glorot_uniform, bias = true)
cell = NASCell(in => out; init, bias)
return NAS(cell)
Expand Down
6 changes: 6 additions & 0 deletions src/rhn_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ end

Flux.@layer RHNCellUnit

"""
RHNCellUnit((in, out)::Pair; init = glorot_uniform, bias = true)
"""
function RHNCellUnit((in, out)::Pair; init = glorot_uniform, bias = true)
weight = init(3 * out, in)
b = create_bias(weight, bias, size(weight, 1))
Expand Down Expand Up @@ -41,6 +44,9 @@ end

Flux.@layer RHNCell

"""
RHNCell((in, out), depth=3; couple_carry::Bool = true, cell_kwargs...)
"""
function RHNCell((in, out), depth=3;
couple_carry::Bool = true,
cell_kwargs...)
Expand Down

0 comments on commit 9047e2c

Please sign in to comment.