layer docs
This commit is contained in:
parent
ef61922dde
commit
a36d6d2af3
@ -9,11 +9,13 @@ makedocs(modules=[Flux],
|
|||||||
pages = ["Home" => "index.md",
|
pages = ["Home" => "index.md",
|
||||||
"Models" =>
|
"Models" =>
|
||||||
["Basics" => "models/basics.md",
|
["Basics" => "models/basics.md",
|
||||||
"Recurrence" => "models/recurrence.md"],
|
"Recurrence" => "models/recurrence.md",
|
||||||
|
"Layers" => "models/layers.md"],
|
||||||
"Contributing & Help" => "contributing.md"])
|
"Contributing & Help" => "contributing.md"])
|
||||||
|
|
||||||
deploydocs(
|
deploydocs(
|
||||||
repo = "github.com/FluxML/Flux.jl.git",
|
repo = "github.com/FluxML/Flux.jl.git",
|
||||||
|
modules = [Flux],
|
||||||
target = "build",
|
target = "build",
|
||||||
osname = "linux",
|
osname = "linux",
|
||||||
julia = "0.6",
|
julia = "0.6",
|
||||||
|
6
docs/src/models/layers.md
Normal file
6
docs/src/models/layers.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
## Model Layers
|
||||||
|
|
||||||
|
```@docs
|
||||||
|
Chain
|
||||||
|
Dense
|
||||||
|
```
|
@ -1,5 +1,18 @@
|
|||||||
# Chain
|
"""
|
||||||
|
Chain(layers...)
|
||||||
|
|
||||||
|
Chain multiple layers / functions together, so that they are called in sequence
|
||||||
|
on a given input.
|
||||||
|
|
||||||
|
m = Chain(x -> x^2, x -> x+1)
|
||||||
|
m(5) == 26
|
||||||
|
|
||||||
|
m = Chain(Dense(10, 5), Dense(5, 2))
|
||||||
|
x = rand(10)
|
||||||
|
m(x) = m[2](m[1](x))
|
||||||
|
|
||||||
|
`Chain` also supports indexing and slicing, e.g. `m[2]` or `m[1:end-1]`.
|
||||||
|
"""
|
||||||
type Chain
|
type Chain
|
||||||
layers::Vector{Any}
|
layers::Vector{Any}
|
||||||
Chain(xs...) = new([xs...])
|
Chain(xs...) = new([xs...])
|
||||||
@ -23,8 +36,13 @@ function Base.show(io::IO, c::Chain)
|
|||||||
print(io, ")")
|
print(io, ")")
|
||||||
end
|
end
|
||||||
|
|
||||||
# Dense
|
"""
|
||||||
|
Dense(in::Integer, out::Integer, σ = identity)
|
||||||
|
|
||||||
|
Creates a traditional `Dense` layer with parameters `W` and `b`.
|
||||||
|
|
||||||
|
y = σ.(W * x .+ b)
|
||||||
|
"""
|
||||||
struct Dense{F,S,T}
|
struct Dense{F,S,T}
|
||||||
σ::F
|
σ::F
|
||||||
W::S
|
W::S
|
||||||
|
Loading…
Reference in New Issue
Block a user