mxnet基础到提高(53)-批量标准化(2)
生活随笔
收集整理的這篇文章主要介紹了
mxnet基础到提高(53)-批量标准化(2)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
moving_var = moving_var * momentum + data_var * (1 - momentum)
如果use_global_stats設置為true,則使用moving_mean和moving_var代替data_mean和data_var來計算輸出。在推理過程中經(jīng)常使用。
參數(shù)axis指定輸入形狀的哪個軸表示“通道”(單獨的標準化組)。默認值為1。指定-1將通道軸設置為輸入形狀中的最后一項。
當fix_gamma設置為True時,不提供稀疏支持。如果fix_gamma設置為False,稀疏張量將回退。
gamma和beta都是可學習的參數(shù)。但如果fix_gamma為真,則將gamma設置為1,并將其漸變設置為0。
Parameters data (NDArray) – Input data to batch normalizationgamma (NDArray) – gamma arraybeta (NDArray) – beta arraymoving_mean (NDArray) – running mean of inputmoving_var (NDArray) – running variance of inputeps (double, optional, default=0.0010000000474974513) – Epsilon to prevent div 0. Must be no less than CUDNN_BN_MIN_EPSILON defined in cudnn.h when using cudnn (usually 1e-5)momentum (float, optional, default=0.899999976) – Momentum for moving averagefix_gamma (boolean, optional, default=1) – Fix gamma while traininguse_global_stats (boolean, optional, default=0) – Whether use global moving statistics instead of local batch-norm. This will force change batch-norm into a scale shift operator.output_mean_var (boolean, optional, default=0) – Output the mean and inverse stdaxis (int, optional, default='1') – Specify which shape axis the channel is specifiedcudnn_off (boolean, optional, default=0) – Do not select CUDNN operator, if availablemin_calib_range (float or None, optional, default=None) – The minimum scalar value in the form of float32 obtained through calibration. If present, it will be used to by quantized batch norm op to calculate primitive scale.Note: this calib_range is to calib bn output.max_calib_range (float or None, optional, default=None) – The maximum scalar value in the form of float32 obtained through calibration. If present, it will be used to by quantized batch norm op to calculate primitive scale.Note: this calib_range is to calib bn output.out (NDArray, optional) – The output NDArray to hold the result.Returns out – The output of this function.Return type NDArray or list of NDArrays總結(jié)
以上是生活随笔為你收集整理的mxnet基础到提高(53)-批量标准化(2)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SpringAop @Pointcut(
- 下一篇: jdk中提供的Collection、Co