# Flux Activations() computes the forward pass again

**URL:** <https://discourse.julialang.org/t/flux-activations-computes-the-forward-pass-again/38904>\
**Category:** Machine Learning\
**Created:** [May 6, 2020, 5:49pm UTC](https://discourse.julialang.org/t/flux-activations-computes-the-forward-pass-again/38904 "2020-05-06T17:49:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaynick](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Post date:** [May 6, 2020, 5:49pm UTC](https://discourse.julialang.org/t/flux-activations-computes-the-forward-pass-again/38904/1 "2020-05-06T17:49:14Z")

</div>

It looks like the activations() function (in basic.jl) computes the forward pass  
to obtain the activations, which would mean that it is computed twice.

I guess a fix for this would be to implement a custom alternative to Chain()  
that propagates both the prediction and a list of activations  
(or, the regularization term involving the activations)  
?

---

<div class="post-metadata">

**Author:** ![CarloLucibello](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carlolucibello/32/3278_2.png) [@CarloLucibello](https://discourse.julialang.org/u/CarloLucibello)\
**Post date:** [May 9, 2020, 5:53am UTC](https://discourse.julialang.org/t/flux-activations-computes-the-forward-pass-again/38904/2 "2020-05-09T05:53:06Z")

</div>

@jaynick could you open an issue on Flux?

---

<div class="post-metadata">

**Author:** ![jaynick](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Post date:** [May 11, 2020, 5:50am UTC](https://discourse.julialang.org/t/flux-activations-computes-the-forward-pass-again/38904/3 "2020-05-11T05:50:43Z")

</div>

[https://github.com/FluxML/Flux.jl/issues/1173](https://github.com/FluxML/Flux.jl/issues/1173)
