def softmax_layer(input_variable, layer_shape, random_state):
    np_W = 0.2 * (random_state.rand(
        *layer_shape).astype(theano.config.floatX) - 0.5)
    W = theano.shared(np_W)
    np_b = np.zeros(layer_shape[1]).astype(theano.config.floatX)
    b = theano.shared(np_b)
    out = tensor.dot(input_variable, W) + b
    params = [W, b]

    e = tensor.exp(out - out.max(axis=1, keepdims=True))
    softmax = e.sum(axis=1, keepdims=True) / e

    # Gradient of softmax not defined... again!
    # softmax = tensor.nnet.softmax(out)
    return softmax, params
dataset/ETHPy150Open kastnerkyle/ift6266h15/convnet.py/softmax_layer/swapped operands of `/`