def _rescale_softmax(sm, min_val):
    """
    .. todo::

        WRITEME
    """
    n_classes = sm.shape[-1]
    # Avoid upcast to float64 when floatX==float32 and n_classes is int64
    n_classes = n_classes.astype(theano.config.floatX)
    return sm * (1 - n_classes * min_val) + min_val
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/expr/activations.py/_rescale_softmax/original