# Correct format for NetChain?

**URL:** <https://community.wolfram.com/t/correct-format-for-netchain/11787>\
**Category:** Questions\
**Tags:** data-science, machine-learning, neural-networks\
**Created:** [January 9, 2018, 2:06pm UTC](https://community.wolfram.com/t/correct-format-for-netchain/11787 "2018-01-09T14:06:02Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![generalrelativity](https://avatars.discourse-cdn.com/v4/letter/g/e9bcb4/32.png) [@generalrelativity](https://community.wolfram.com/u/generalrelativity)\
**Post date:** [January 9, 2018, 2:06pm UTC](https://community.wolfram.com/t/correct-format-for-netchain/11787/1 "2018-01-09T14:06:02Z")

</div>

I am trying to create a simple neural network with one hidden layer to recognise hand written characters from the MNIST training set. I would like my hidden layer to be an ElementwiseLayer[LogisticSigmoid] with 30 neurons. I would have expected the syntax for a linear layer to be

```
NetChain[{LinearLayer[30]}, 
 "Input" -> NetEncoder[{"Image", {28, 28}, "Grayscale"}], 
 "Output" -> NetDecoder[{"Class", Range[0, 9]}]]

```

But this generates the error

```
"Specification NetDecoder[Class, ...]) is not compatible with port "Output", which must be a length-30 vector"

```

Does anyone have an idea what the correct syntax is to achieve what I want?

Thanks

---

_[View the full topic](https://community.wolfram.com/t/correct-format-for-netchain/11787)._
