adding the extra commits broke the accumulate version

This commit is contained in:
dsweber2 2019-09-10 01:34:12 -07:00
parent cdaaca8cfa
commit d0202a2945

View File

@ -50,9 +50,12 @@ end
Calculate the forward results of each layers in Chain `c` with `input` as model input.
"""
function activations(c::Chain, input)
buffed = accumulate!((x,y)->y(x), Zygote.Buffer([], length(c)),
[l for l in c], dims=1, init=input)
return copy(buffed)
res = Zygote.Buffer([], length(c))
res[1] = c[1](input)
for (i,l) in enumerate(c[2:end])
res[i+1] = l(res[i])
end
return copy(res)
end