convert parameters also
This commit is contained in:
parent
42fabadd11
commit
a71c79e920
@ -49,7 +49,7 @@ interp(ctx, c::Conv2D, x) =
|
|||||||
interp{T<:AArray}(ctx, p::Constant{Flux.Param{T}}) =
|
interp{T<:AArray}(ctx, p::Constant{Flux.Param{T}}) =
|
||||||
haskey(ctx[:params], p.value) ?
|
haskey(ctx[:params], p.value) ?
|
||||||
ctx[:params][p.value] :
|
ctx[:params][p.value] :
|
||||||
(ctx[:params][p.value] = Variable(p.value.x))
|
(ctx[:params][p.value] = Variable(convertel(Float32, p.value.x)))
|
||||||
|
|
||||||
interp(ctx, p::Constant) = p.value
|
interp(ctx, p::Constant) = p.value
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ export AArray
|
|||||||
|
|
||||||
const AArray = AbstractArray
|
const AArray = AbstractArray
|
||||||
|
|
||||||
initn(dims...) = randn(Float32, dims...)/10
|
initn(dims...) = randn(dims...)/10
|
||||||
|
|
||||||
function train!(m, train, test = []; epoch = 1, batch = 10, η = 0.1)
|
function train!(m, train, test = []; epoch = 1, batch = 10, η = 0.1)
|
||||||
i = 0
|
i = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user