AIfES 2
2.0.0
|
General Tanh layer struct. More...
#include <ailayer_tanh.h>
Data Fields | |
ailayer_t | base |
Inherited field members from general ailayer struct. | |
Math functions | |
Required data type specific math functions | |
void(* | tanh )(const aitensor_t *x, aitensor_t *result) |
Required math function: Tanh. More... | |
void(* | d_tanh )(const aitensor_t *tanh_x, aitensor_t *result) |
Required math function: Derivative of tanh. More... | |
void(* | multiply )(const aitensor_t *a, const aitensor_t *b, aitensor_t *result) |
Required math function: Element wise tensor multiplication. More... | |
General Tanh layer struct.
void(* d_tanh) (const aitensor_t *tanh_x, aitensor_t *result) |
Required math function: Derivative of tanh.
Requires a math function that calculates the element wise tanh derivative of a tensor:
\[ result_{i} = tanh'(x_{i}) = 1 - tanh(x_{i})^2 \]
tanh_x | N-dimensional tensor with the tanh values \( tanh(x_{i}) \) (input) |
result | N-dimensional tensor (output) |
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 \]
void(* tanh) (const aitensor_t *x, aitensor_t *result) |
Required math function: Tanh.
Requires a math function that calculates the element wise tanh of a tensor:
\[ result_{i} = \tanh(x_{i}) = \frac{e^{x_i} - e^{-x_i}}{e^{x_i} + e^{-x_i}} \]
x | N-dimensional tensor (input) |
result | N-dimensional tensor (output) |