batchnorm

相关公式

batchnorm_第1张图片



NCNN代码

int BatchNorm::forward_inplace(Mat& bottom_top_blob) const
{
    // a = bias - slope * mean / sqrt(var)
    // b = slope / sqrt(var)
    // value = b * value + a

    int w = bottom_top_blob.w;
    int h = bottom_top_blob.h;
    int size = w * h;

    const float* a_data_ptr = a_data;
    const float* b_data_ptr = b_data;
    #pragma omp parallel for
    for (int q=0; q

参考资料

[1] Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift
[2] https://github.com/Tencent/ncnn

你可能感兴趣的:(机器学习,语音识别)