Skip to content

Added deprecation warning to Dense(in,out,act,initW,initb) #722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/layers/basic.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Base: depwarn

"""
Chain(layers...)

Expand Down Expand Up @@ -71,7 +73,18 @@ end
Dense(W, b) = Dense(W, b, identity)

function Dense(in::Integer, out::Integer, σ = identity;
initW = glorot_uniform, initb = zeros)
initW = nothing, initb = nothing)
if initW != nothing || initb != nothing
depwarn("Dense(in,out,σ,initW,initb) is deprecated; use Dense(W,b) instead",:Dense)
Copy link
Contributor

@johnnychen94 johnnychen94 Apr 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "keyword argument `initW` is deprecated; use `Dense(W,b)` to initialize" is more descriptive to the current one.

end

if initW == nothing
initW = glorot_uniform
end
if initb == nothing
initb = zeros
end

return Dense(param(initW(out, in)), param(initb(out)), σ)
end

Expand Down