AIfES 2  2.0.0
ailayer_leaky_relu Struct Reference

General Leaky ReLU layer struct. More...

#include <ailayer_leaky_relu.h>

Data Fields

ailayer_t base
 Inherited field members from general ailayer struct.
 
Layer configuration

Required configuration parameters for the layer

These fields have to be configured by the user before calling the initializer function.

void * alpha
 Parameter \( \alpha \) used to calculate Leaky ReLU function for input values < 0.
 
const aimath_dtype_talpha_dtype
 Data type of scalar parameter \( \alpha \).
 
Math functions

Required data type specific math functions

void(* leaky_relu )(const aitensor_t *x, const void *alpha, aitensor_t *result)
 Required math function: Leaky ReLU. More...
 
void(* d_leaky_relu )(const aitensor_t *x, const void *alpha, aitensor_t *result)
 Required math function: Derivative of Leaky ReLU. More...
 
void(* multiply )(const aitensor_t *a, const aitensor_t *b, aitensor_t *result)
 Required math function: Element wise tensor multiplication. More...
 

Detailed Description

General Leaky ReLU layer struct.

Field Documentation

◆ d_leaky_relu

void(* d_leaky_relu) (const aitensor_t *x, const void *alpha, aitensor_t *result)

Required math function: Derivative of Leaky ReLU.

Requires a math function that calculates the element wise Leaky ReLU derivative of a tensor:

\[ result_{i} = \begin{cases} \alpha & \text{if } x_i < 0\\ 1 & \text{if } x_i \geq 0 \end{cases} \]

Parameters
xN-dimensional tensor (input)
resultN-dimensional tensor (output)

◆ leaky_relu

void(* leaky_relu) (const aitensor_t *x, const void *alpha, aitensor_t *result)

Required math function: Leaky ReLU.

Requires a math function that calculates the element wise Leaky ReLU of a tensor:

\[ result_{i} = \begin{cases} \alpha \cdot x_i & \text{if } x_i < 0 \\ x_i & \text{if } x_i \geq 0 \end{cases} \]

Parameters
xN-dimensional tensor (input)
resultN-dimensional tensor (output)

◆ multiply

void(* multiply) (const aitensor_t *a, const aitensor_t *b, aitensor_t *result)

Required math function: Element wise tensor multiplication.

Requires a math function that multiplies two tensors element wise:

\[ result = a \circ b \]


The documentation for this struct was generated from the following file: