Flux.jl/src/layers/dense.jl

21 lines
353 B
Julia
Raw Normal View History

2016-08-22 20:13:28 +00:00
export Dense
2016-08-22 13:49:41 +00:00
@model type Dense
W
b
x -> W*x + b
end
2016-08-25 16:25:33 +00:00
Dense(in::Integer, out::Integer; init = initn) =
2016-08-22 13:49:41 +00:00
Dense(init(out, in), init(out))
2016-08-23 13:14:20 +00:00
2016-08-25 16:24:39 +00:00
Base.show(io::IO, ::Dense) = print(io, "Flux.Dense(...)")
2016-08-23 13:14:20 +00:00
@model type Sigmoid
layer::Model
x -> σ(layer(x))
end
Sigmoid(in::Integer, out::Integer; init = randn) =
Sigmoid(Dense(in, out, init = init))