def softmax(X):
    e_x = T.exp(X - X.max(axis=1).dimshuffle(0, 'x'))
    return e_x / e_x.sum(axis=1).dimshuffle(0, 'x')
dataset/ETHPy150Open Newmu/Theano-Tutorials/5_convolutional_net.py/softmax/original