remove fake batching vestiges

This commit is contained in:
Mike J Innes 2017-04-19 13:19:18 +01:00
parent 52bd0f9b00
commit 5357b1e9f9
2 changed files with 3 additions and 18 deletions

View File

@ -27,21 +27,3 @@ end
convertel(T::Type, xs::Batch) =
eltype(eltype(xs)) isa T ? 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)

View File

@ -2,6 +2,9 @@ export AArray
const AArray = AbstractArray
mapt(f, x) = f(x)
mapt(f, xs::Tuple) = map(x -> mapt(f, x), xs)
initn(dims...) = randn(dims...)/100
function train!(m, train, test = []; epoch = 1, batch = 10, η = 0.1)