# Interpretation of the weights returned by Flux in model zoo example

**URL:** <https://discourse.julialang.org/t/interpretation-of-the-weights-returned-by-flux-in-model-zoo-example/15247>\
**Category:** New to Julia\
**Tags:** flux\
**Created:** [September 20, 2018, 6:58pm UTC](https://discourse.julialang.org/t/interpretation-of-the-weights-returned-by-flux-in-model-zoo-example/15247 "2018-09-20T18:58:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![metanoid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/metanoid/32/3541_2.png) [@metanoid](https://discourse.julialang.org/u/metanoid)\
**Post date:** [September 20, 2018, 6:58pm UTC](https://discourse.julialang.org/t/interpretation-of-the-weights-returned-by-flux-in-model-zoo-example/15247/1 "2018-09-20T18:58:19Z")

</div>

I’m trying to dig through the model zoo examples for Flux to learn.  
One of these is FizzBuzz:  
[Github source here](https://github.com/FluxML/model-zoo/blob/master/other/fizzbuzz/fizzbuzz.jl)

The model is defined as  
`m = Chain(Dense(3, 10), Dense(10, 4), NNlib.softmax)`

To me, this looks like 2 Dense layers (i.e. nodes with parameter weights) plus one softmax layer (i.e. has no trainable parameters.

However, when I call `params(m)` I get 4 sets of weights:

- a 10x3 (which I expected)
- a 10x1 (which I did not expect)
- a 4x10 (which I expected)
- a 4x1 (which I did not expect)

Can anyone please explain what the intepretation of the nx1 layers is? Why are they there?

---

<div class="post-metadata">

**Author:** ![denizyuret](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/denizyuret/32/568_2.png) [@denizyuret](https://discourse.julialang.org/u/denizyuret)\
**Post date:** [September 20, 2018, 9:57pm UTC](https://discourse.julialang.org/t/interpretation-of-the-weights-returned-by-flux-in-model-zoo-example/15247/2 "2018-09-20T21:57:48Z")

</div>

These look like bias vectors.

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [September 20, 2018, 11:32pm UTC](https://discourse.julialang.org/t/interpretation-of-the-weights-returned-by-flux-in-model-zoo-example/15247/3 "2018-09-20T23:32:15Z")

</div>

Define a Dense layer and give it a name, say layer. Then do layer. to see what’s inside. You will find a W matrix and a b vector.

---

<div class="post-metadata">

**Author:** ![metanoid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/metanoid/32/3541_2.png) [@metanoid](https://discourse.julialang.org/u/metanoid)\
**Post date:** [September 21, 2018, 3:50pm UTC](https://discourse.julialang.org/t/interpretation-of-the-weights-returned-by-flux-in-model-zoo-example/15247/4 "2018-09-21T15:50:53Z")

</div>

This is correct. I had just forgotten. Thanks for your help.
