def LReLU_function( signal, derivative=False, leakage = 0.01 ):
    """
    Leaky Rectified Linear Unit
    """
    if derivative:
        # Return the partial derivation of the activation function
        return np.clip(signal > 0, leakage, 1.0)
    else:
        # Return the activation signal
        output = np.copy( signal )
        output[ output < 0 ] *= leakage
        return output
def LReLU_function ( signal , derivative = False , leakage = 0.01 ) : if derivative : return np . clip ( signal > 0 , leakage , 1.0 ) else : output = np . copy ( signal ) output [ output < 0 ] *= leakage return output
Leaky Rectified Linear Unit