(feat, sums, square, count, axis=(0, 1))
return sums, square, count
aggregate CMVN statistic
aggregate CMVN statistic
aggregate CMVN statistic
def update_cmvn_statis(feat, sums, square, count, axis=(0, 1)):
  ''' aggregate CMVN statistic '''
  # feat shape [ batch, frames, feat, channle]
  assert feat.ndim == 4
  sums += np.expand_dims(np.sum(feat, axis=axis), axis=0)
  square += np.expand_dims(np.sum(np.square(feat), axis=axis), axis=0)
  count += np.prod(feat.shape[:len(axis)])
  return sums, square, count
def update_cmvn_statis ( feat , sums , square , count , axis = ( 0 , 1 ) ) : # feat shape [ batch, frames, feat, channle] assert feat . ndim == 4 sums += np . expand_dims ( np . sum ( feat , axis = axis ) , axis = 0 ) square += np . expand_dims ( np . sum ( np . square ( feat ) , axis = axis ) , axis = 0 ) count += np . prod ( feat . shape [ : len ( axis ) ] ) return sums , square , count