def test_softmax_generality():
 nvis = 1
 num_classes = 2
 model = MLP(layers=[Softmax(num_classes, 's', irange=0.1)], nvis=nvis)
 Z = T.matrix()
 Y_hat = T.nnet.softmax(Z)
 Y = T.matrix()
 model.layers[(-1)].cost(Y=Y, Y_hat=Y_hat)

def test_softmax_generality ( ) : nvis = 1 num_classes = 2 model = MLP ( layers = [ Softmax ( num_classes , 's' , irange = 0.1 ) ] , nvis = nvis ) Z = T . matrix ( ) Y_hat = T . nnet . softmax ( Z ) Y = T . matrix ( ) model . layers [ ( - 1 ) ] . cost ( Y = Y , Y_hat = Y_hat )
tests that the softmax layer can score outputs it did not create .