Hi

I want to initialize a Dense with weights initialized.

I don’t expect to use initializers in Flux package.

I already have had a Float64 vector before and want to use it as weights.

But I met error

Blockquote

using Flux

w0 = Float64[0.1, 0.2, 0.3, 0.4]

nn = Dense(w0)

println(nn)

And error:

Blockquote

ERROR: LoadError: MethodError: no method matching Dense(::Vector{Float64})

Closest candidates are:

Dense(::LinearAlgebra.Diagonal, ::Any, ::Any)

@ Flux ~/.julia/packages/Flux/MtsAN/src/layers/basic.jl:190

Dense(::LinearAlgebra.Diagonal)

@ Flux ~/.julia/packages/Flux/MtsAN/src/layers/basic.jl:190

Dense(::LinearAlgebra.Diagonal, ::Any)

@ Flux ~/.julia/packages/Flux/MtsAN/src/layers/basic.jl:190

…

Stacktrace:

[1] top-level scope trial2.jl:3

How could I solve this problem?

Thanks