better default init
This commit is contained in:
parent
fd67383494
commit
afac5d8bfe
|
@ -6,7 +6,7 @@ export Dense
|
|||
x -> W*x + b
|
||||
end
|
||||
|
||||
Dense(in::Integer, out::Integer; init = randn) =
|
||||
Dense(in::Integer, out::Integer; init = initn) =
|
||||
Dense(init(out, in), init(out))
|
||||
|
||||
Base.show(io::IO, ::Dense) = print(io, "Flux.Dense(...)")
|
||||
|
|
|
@ -6,6 +6,8 @@ onehot(label, labels) = [i == label for i in labels]
|
|||
onecold(pred, labels = 1:length(pred)) = labels[findfirst(pred, maximum(pred))]
|
||||
|
||||
function train!(m::Model, train, test = []; epoch = 1, batch = 10, η = 0.1)
|
||||
initn(dims...) = randn(dims...)/100
|
||||
|
||||
i = 0
|
||||
∇ = zeros(length(train[1][2]))
|
||||
for _ in 1:epoch
|
||||
|
|
Loading…
Reference in New Issue