# RNN weights definition in Flux

**URL:** <https://discourse.julialang.org/t/rnn-weights-definition-in-flux/59623>\
**Category:** Machine Learning\
**Created:** [April 19, 2021, 10:59pm UTC](https://discourse.julialang.org/t/rnn-weights-definition-in-flux/59623 "2021-04-19T22:59:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sunny](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@Sunny](https://discourse.julialang.org/u/Sunny)\
**Post date:** [April 19, 2021, 10:59pm UTC](https://discourse.julialang.org/t/rnn-weights-definition-in-flux/59623/1 "2021-04-19T22:59:22Z")

</div>

In the Flux source files there is a line.

```julia
@functor RNNCell

```

How does the functor understand that `state0` and `\sigma` (which should be fixed) in RNNCell definition aren’t weights?

---

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [November 7, 2021, 7:21pm UTC](https://discourse.julialang.org/t/rnn-weights-definition-in-flux/59623/2 "2021-11-07T19:21:24Z")

</div>

It doesn’t. The state field is excluded by [https://github.com/FluxML/Flux.jl/blob/b7df765301e6fc00b582112daf58916bb6728c24/src/layers/recurrent.jl#L65](https://github.com/FluxML/Flux.jl/blob/b7df765301e6fc00b582112daf58916bb6728c24/src/layers/recurrent.jl#L65), which Flux.params calls under the hood.
