Flux.jl/src/layers/affine.jl
2016-11-15 00:09:53 +00:00

21 lines
333 B
Julia
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export Affine
# TODO: type hints for parameters
@net type Affine
W
b
x -> x*W + b
end
Affine(in::Integer, out::Integer; init = initn) =
Affine(init(in, out), init(1, out))
@net type Sigmoid
layer::Model
x -> σ(layer(x))
end
Sigmoid(in::Integer, out::Integer; init = randn) =
Sigmoid(Affine(in, out, init = init))