Add running mean and running var to batchnorm

This commit is contained in:
2024-08-25 19:05:10 +02:00
parent 1136ca452f
commit 9704d0d53e
8 changed files with 205 additions and 71 deletions

View File

@@ -141,7 +141,6 @@ __global__ void vec_exp(
* @param src Device pointer to source vector
* @param dst Device pointer to destination vector
* @param len Length of the vector
* @return __global__
*/
__global__ void vec_sqrt(
const float* __restrict__ src,
@@ -149,6 +148,23 @@ __global__ void vec_sqrt(
const unsigned int len
);
/**
* @brief Scales the vector by 1/sqrt(scale + epsilon)
*
* @param src Device pointer to source vector
* @param dst Device pointer to destination vector
* @param scale Scale
* @param epsilon Epsilon
* @param len Length of the vector
*/
__global__ void vec_scale(
const float* __restrict__ src,
float* __restrict__ dst,
const float* __restrict__ scale,
const float* epsilon,
const unsigned int len
);
/**
* @brief Max reduction kernel
*