From f6771b98cd3b32a659f39143f050b585059de05c Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Sat, 2 Sep 2017 16:50:11 -0400 Subject: [PATCH] clearer name for dense --- src/Flux.jl | 2 +- src/layers/basic.jl | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Flux.jl b/src/Flux.jl index 6426ff8e..1103fdbb 100644 --- a/src/Flux.jl +++ b/src/Flux.jl @@ -7,7 +7,7 @@ module Flux using Juno using Lazy: @forward -export Chain, Linear +export Chain, Dense using NNlib export σ, relu, softmax diff --git a/src/layers/basic.jl b/src/layers/basic.jl index 911a2ce4..cfbbf7a4 100644 --- a/src/layers/basic.jl +++ b/src/layers/basic.jl @@ -23,23 +23,23 @@ function Base.show(io::IO, c::Chain) print(io, ")") end -# Linear +# Dense -struct Linear{F,S,T} +struct Dense{F,S,T} σ::F W::S b::T end -Linear(in::Integer, out::Integer, σ = identity; init = initn) = - Linear(σ, track(init(out, in)), track(init(out))) +Dense(in::Integer, out::Integer, σ = identity; init = initn) = + Dense(σ, track(init(out, in)), track(init(out))) -Optimise.children(d::Linear) = (d.W, d.b) +Optimise.children(d::Dense) = (d.W, d.b) -(a::Linear)(x) = a.σ.(a.W*x .+ a.b) +(a::Dense)(x) = a.σ.(a.W*x .+ a.b) -function Base.show(io::IO, l::Linear) - print(io, "Linear(", size(l.W, 2), ", ", size(l.W, 1)) +function Base.show(io::IO, l::Dense) + print(io, "Dense(", size(l.W, 2), ", ", size(l.W, 1)) l.σ == identity || print(io, ", ", l.σ) print(io, ")") end