I'm trying to learn neural networks in the Wolfram language, so I've written the following code. The input is a $2*3$ matrix, split into two parts. The parts are given to distinct linear layers, then the results concatenated and soft-maxed.
g1 = NetGraph[<| "c" -> CatenateLayer[], "s" -> SoftmaxLayer[],
"p1" -> PartLayer[1,"Input" -> {2, 3}], "p2" -> PartLayer[2, "Input" -> {2, 3}],
"l1" -> LinearLayer[1], "l2" -> LinearLayer[1]|>,
{NetPort["input"] -> "p1" -> "l1",
NetPort["input"] -> "p2" -> "l2",
{"l1", "l2"} -> "c" -> "s" -> NetPort["output"]}];
g2 = NetInitialize[g1]
g2[{{1, 2, 3}, {4, 5, 6}}]
NetTrain[g2, {{{1, 2, 3}, {4,5,6}} -> {0.2, 0.8}}]
Initializations and initial evaluations work, but training does not. This gives the following error: I don't know what's causing it or how to fix it. The network seems correct as far as I can tell.