remove fake batching vestiges
This commit is contained in:
parent
52bd0f9b00
commit
5357b1e9f9
@ -27,21 +27,3 @@ end
|
|||||||
convertel(T::Type, xs::Batch) =
|
convertel(T::Type, xs::Batch) =
|
||||||
eltype(eltype(xs)) isa T ? xs :
|
eltype(eltype(xs)) isa T ? xs :
|
||||||
Batch(map(x->convertel(T, x), xs))
|
Batch(map(x->convertel(T, x), xs))
|
||||||
|
|
||||||
# Add batching semantics to functions operating on raw arrays
|
|
||||||
# TODO: remove this in favour of full batching semantics
|
|
||||||
|
|
||||||
mapt(f, x) = f(x)
|
|
||||||
mapt(f, xs::Tuple) = map(x -> mapt(f, x), xs)
|
|
||||||
|
|
||||||
batchone(x) = Batch((x,))
|
|
||||||
batchone(x::Batch) = x
|
|
||||||
|
|
||||||
function unbatchone(xs::Batch)
|
|
||||||
@assert length(xs) == 1
|
|
||||||
return first(xs)
|
|
||||||
end
|
|
||||||
|
|
||||||
isbatched(x) = false
|
|
||||||
isbatched(x::Batch) = true
|
|
||||||
isbatched(xs::Tuple) = any(isbatched, xs)
|
|
||||||
|
@ -2,6 +2,9 @@ export AArray
|
|||||||
|
|
||||||
const AArray = AbstractArray
|
const AArray = AbstractArray
|
||||||
|
|
||||||
|
mapt(f, x) = f(x)
|
||||||
|
mapt(f, xs::Tuple) = map(x -> mapt(f, x), xs)
|
||||||
|
|
||||||
initn(dims...) = randn(dims...)/100
|
initn(dims...) = randn(dims...)/100
|
||||||
|
|
||||||
function train!(m, train, test = []; epoch = 1, batch = 10, η = 0.1)
|
function train!(m, train, test = []; epoch = 1, batch = 10, η = 0.1)
|
||||||
|
Loading…
Reference in New Issue
Block a user