From 1bb25dc1f9c54666d73b516629e0c89033e1c0e2 Mon Sep 17 00:00:00 2001 From: dsweber2 Date: Tue, 10 Sep 2019 01:34:12 -0700 Subject: [PATCH] adding the extra commits broke the accumulate version --- src/layers/basic.jl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/layers/basic.jl b/src/layers/basic.jl index fd187d8c..e1e9ab45 100644 --- a/src/layers/basic.jl +++ b/src/layers/basic.jl @@ -51,9 +51,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