I have a simple net:
net = NetInitialize@
NetChain[{LinearLayer[2], SoftmaxLayer[]}, "Input" -> 2,
"Output" -> NetDecoder[{"Class", {0, 1}}]]
net@RandomReal[{-1, 1}, {10, 2}]
How do I return probabilites after SoftmaxLayer
? Right now I have to insert dummy ElementwiseLayer[Identity]
in the end of a chain and then Take[net,2]
would return what I actually need.
net[#, "Probabilities"][[All, Key[1]]]&
works for me $\endgroup$