Why does this not work? Sorry, I’m a newbie with NNs.
The encoders and decoders are not layers but net port properties and you need to attached them to a port.
This will work as you expect
dec = NetDecoder[{"Class", {"a", "b", "c"}}];
NNcompare =
NetInitialize@
NetChain[{3, LogisticSigmoid, 3, LogisticSigmoid, 3, LogisticSigmoid, 3,
SoftmaxLayer[]}, "Output" -> dec, "Input" -> 2];
NNcompare[{1, 2}]
(* "b" *)
I have fixed the input size to be able to initialize the net and use it but that can also be done at training time (the size will be inferred from the training data).
Thank you! Do you know how to display the value of the loss function after it’s done training? It shows it while the optimization is ongoing, but then the display disappears. Oh, never mind, I figured it out.