module documentation

A Collection of derivatives for the activation functions

Function d_leakyrelu Partial derivative for leaky relu function
Function d_relu Partial derivative for relu function
Function d_sigmoid The partial derivative of sigmoid function
Function d_softmax Not implemented yet
Function d_tanh The partial derivative for hyperbolic tangent
Function get Helper function to get an activation function derivative
def d_leakyrelu(x: np.ndarray, leakyrelu_slope: float, **kwargs) -> np.ndarray: (source)

Partial derivative for leaky relu function

Formula: slope if x < 0 else 1

def d_relu(x: np.ndarray, **kwargs) -> np.ndarray: (source)

Partial derivative for relu function

Formula: 0 if x < 0 else 1

def d_sigmoid(x: np.ndarray, **kwargs) -> np.ndarray: (source)

The partial derivative of sigmoid function

If sigmoid is g(x) g'(x) = g(x)(1 - g(x))

def d_softmax(x: np.ndarray, **kwargs) -> np.ndarray: (source)

Not implemented yet

def d_tanh(x: np.ndarray, **kwargs) -> np.ndarray: (source)

The partial derivative for hyperbolic tangent

If tanh is g(x) g'(x) = 1 - g(x)^2

def get(func: str): (source)

Helper function to get an activation function derivative

Return the appropriate activation function depending on the given string

Args
func:
Query string for the requested activation function derivative
Returns
Appropriate function