pyanomaly/networks/meta/pcn_parts/prednet.py
def hard_sigmoid(x):
    '''
    - hard sigmoid function by zcr.
    - Computes element-wise hard sigmoid of x.
    - what is hard sigmoid?
        Segment-wise linear approximation of sigmoid. Faster than sigmoid.
        Returns 0. if x < -2.5, 1. if x > 2.5. In -2.5 <= x <= 2.5, returns 0.2 * x + 0.5.
    - See e.g. https://github.com/Theano/Theano/blob/master/theano/tensor/nnet/sigm.py#L279
    '''
    slope = 0.2
    shift = 0.5
    x = (slope * x) + shift
    x = F.threshold(-x, -1, -1)
    x = F.threshold(-x, 0, 0)
    return x

    - hard sigmoid function by zcr.
    - Computes element-wise hard sigmoid of x.
    - what is hard sigmoid?
        Segment-wise linear approximation of sigmoid. Faster than sigmoid.
        Returns 0. if x < -2.5, 1. if x > 2.5. In -2.5 <= x <= 2.5, returns 0.2 * x + 0.5.
    - See e.g. https://github.com/Theano/Theano/blob/master/theano/tensor/nnet/sigm.py#L279
    
hard sigmoid function by zcr.
Computes element-wise hard sigmoid of x.
what is hard sigmoid.
Segment-wise linear approximation of sigmoid. Faster than sigmoid.
Returns 0.
hard sigmoid function by zcr . Computes element - wise hard sigmoid of x . what is hard sigmoid . Segment - wise linear approximation of sigmoid . Faster than sigmoid . Returns 0 .
def hard_sigmoid(x):
    slope = 0.2
    shift = 0.5
    x = (slope * x) + shift
    x = F.threshold(-x, -1, -1)
    x = F.threshold(-x, 0, 0)
    return x
def hard_sigmoid ( x ) : slope = 0.2 shift = 0.5 x = ( slope * x ) + shift x = F . threshold ( - x , - 1 , - 1 ) x = F . threshold ( - x , 0 , 0 ) return x
hard sigmoid function by zcr.
hard sigmoid function by zcr .
'''
    - hard sigmoid function by zcr.
    - Computes element-wise hard sigmoid of x.
    - what is hard sigmoid?
        Segment-wise linear approximation of sigmoid. Faster than sigmoid.
        Returns 0. if x < -2.5, 1. if x > 2.5. In -2.5 <= x <= 2.5, returns 0.2 * x + 0.5.
    - See e.g. https://github.com/Theano/Theano/blob/master/theano/tensor/nnet/sigm.py#L279
    '''
x