# Number of nodes per layer in fluid.mlpregressor~?

**URL:** <https://discourse.flucoma.org/t/number-of-nodes-per-layer-in-fluid-mlpregressor/687>\
**Category:** Pre-Release Toolbox2 Usage\
**Created:** [October 24, 2020, 10:04pm UTC](https://discourse.flucoma.org/t/number-of-nodes-per-layer-in-fluid-mlpregressor/687 "2020-10-24T22:04:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![balintlaczko](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/balintlaczko/32/1184_2.png) [@balintlaczko](https://discourse.flucoma.org/u/balintlaczko)\
**Post date:** [October 24, 2020, 10:04pm UTC](https://discourse.flucoma.org/t/number-of-nodes-per-layer-in-fluid-mlpregressor/687/1 "2020-10-24T22:04:25Z")

</div>

Hey!

Just wondering if it is possible to set the number of nodes in a layer for `fluid.mlpregressor~`? The docs mention that it defaults to 2 layers and 3 nodes/layer. It’s clear that one can set the number of layers with `@hidden`, but how to set the nodes?

Thanks,  
B

---

<div class="post-metadata">

**Author:** ![rodrigo.constanzo](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/rodrigo.constanzo/32/12_2.png) [@rodrigo.constanzo](https://discourse.flucoma.org/u/rodrigo.constanzo)\
**Post date:** [October 25, 2020, 1:04am UTC](https://discourse.flucoma.org/t/number-of-nodes-per-layer-in-fluid-mlpregressor/687/2 "2020-10-25T01:04:49Z")

</div>

`@hidden` takes a list, so you input however many layers you want, and the number per entry in the list is the amount of nodes per layer.

---

<div class="post-metadata">

**Author:** ![balintlaczko](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/balintlaczko/32/1184_2.png) [@balintlaczko](https://discourse.flucoma.org/u/balintlaczko)\
**Post date:** [October 25, 2020, 8:54am UTC](https://discourse.flucoma.org/t/number-of-nodes-per-layer-in-fluid-mlpregressor/687/3 "2020-10-25T08:54:26Z")

</div>

Ah I see! Thanks!!

---

<div class="post-metadata">

**Author:** ![tremblap](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tremblap/32/5_2.png) [@tremblap](https://discourse.flucoma.org/u/tremblap)\
**Post date:** [October 25, 2020, 9:50am UTC](https://discourse.flucoma.org/t/number-of-nodes-per-layer-in-fluid-mlpregressor/687/4 "2020-10-25T09:50:07Z")

</div>

the in and out are set by your input and output size, but yes, hidden is a list of your hidden layers structures. they share the same activation, except the output one which has its own attribute

---

<div class="post-metadata">

**Author:** ![balintlaczko](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/balintlaczko/32/1184_2.png) [@balintlaczko](https://discourse.flucoma.org/u/balintlaczko)\
**Post date:** [October 25, 2020, 1:21pm UTC](https://discourse.flucoma.org/t/number-of-nodes-per-layer-in-fluid-mlpregressor/687/5 "2020-10-25T13:21:54Z")

</div>

I see. So if I have `@hidden 3 64` will I get 3 hidden layers with 64 nodes each?

---

<div class="post-metadata">

**Author:** ![rodrigo.constanzo](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/rodrigo.constanzo/32/12_2.png) [@rodrigo.constanzo](https://discourse.flucoma.org/u/rodrigo.constanzo)\
**Post date:** [October 25, 2020, 1:26pm UTC](https://discourse.flucoma.org/t/number-of-nodes-per-layer-in-fluid-mlpregressor/687/6 "2020-10-25T13:26:02Z")

</div>

Nope. Syntax is a bit confusing…

If you want three hidden layers with 64 nodes each it would be `@hidden 64 64 64`. In other places the general syntax is [number] -\> [modifier] (e.g. `@addrange 2 4` = start at column 2 and add 4 columns after that), but here it’s completely separate numbers denoting the amount of nodes per layer.

---

<div class="post-metadata">

**Author:** ![rodrigo.constanzo](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/rodrigo.constanzo/32/12_2.png) [@rodrigo.constanzo](https://discourse.flucoma.org/u/rodrigo.constanzo)\
**Post date:** [October 25, 2020, 1:28pm UTC](https://discourse.flucoma.org/t/number-of-nodes-per-layer-in-fluid-mlpregressor/687/7 "2020-10-25T13:28:23Z")

</div>

As an aside, I’m guessing this is another [scikit](https://scikit-learn.org/stable/) syntax import, but something like `@structure` or `@hiddenlayers` or something like that may make more sense in terms of legibility as the singular of `@hidden` makes it unclear that it takes a list (like `@fftsettingSSS`), and also makes it seem like it’s referring to something else, like a binary flag or something.

---

<div class="post-metadata">

**Author:** ![balintlaczko](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/balintlaczko/32/1184_2.png) [@balintlaczko](https://discourse.flucoma.org/u/balintlaczko)\
**Post date:** [October 25, 2020, 1:49pm UTC](https://discourse.flucoma.org/t/number-of-nodes-per-layer-in-fluid-mlpregressor/687/8 "2020-10-25T13:49:51Z")

</div>

OK! Yes, +1 for naming it `@hiddenlayers` to suggest it is a list. It is also very good that you can set the sizes per layer! In tensorflow/keras I usually see that the first hidden layer is the biggest, and then it feeds forward to gradually smaller layers something like `@hidden 128 64 32` (or maybe 64 64 32 16, depends on the speed and the complexity/nature of the task…).
