mxnet基础到提高(53)-批量标准化(2)
生活随笔
收集整理的這篇文章主要介紹了
mxnet基础到提高(53)-批量标准化(2)
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
moving_var = moving_var * momentum + data_var * (1 - momentum)
如果use_global_stats設(shè)置為true,則使用moving_mean和moving_var代替data_mean和data_var來(lái)計(jì)算輸出。在推理過(guò)程中經(jīng)常使用。
參數(shù)axis指定輸入形狀的哪個(gè)軸表示“通道”(單獨(dú)的標(biāo)準(zhǔn)化組)。默認(rèn)值為1。指定-1將通道軸設(shè)置為輸入形狀中的最后一項(xiàng)。
當(dāng)fix_gamma設(shè)置為T(mén)rue時(shí),不提供稀疏支持。如果fix_gamma設(shè)置為False,稀疏張量將回退。
gamma和beta都是可學(xué)習(xí)的參數(shù)。但如果fix_gamma為真,則將gamma設(shè)置為1,并將其漸變?cè)O(shè)置為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)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: SpringAop @Pointcut(
- 下一篇: Springboot中@Componen