(self, feat_list, is_end=False)
return 0, []
calculate the mean and variance of the feat
        args:
            feat_list: feat list such as [[key, array]...]
            is_end: if is the last feat_list, set it to True,
                    else set it to False
        return:
            -1, []: failed
            0, []: when is_end is True, return the mean and variance list
                   else return empty list
calculate the mean and variance of the feat
        args:
            feat_list: feat list such as [[key, array]...]
            is_end: if is the last feat_list, set it to True,
                    else set it to False
        return:
            -1, []: failed
            0, []: when is_end is True, return the mean and variance list
                   else return empty list
calculate the mean and variance of the feat args : feat_list : feat list such as [[ key array ] ... ] is_end : if is the last feat_list set it to True else set it to False return : - 1 [] : failed 0 [] : when is_end is True return the mean and variance list else return empty list
def calculate_mean_variance(self, feat_list, is_end=False):
    """
        calculate the mean and variance of the feat
        args:
            feat_list: feat list such as [[key, array]...]
            is_end: if is the last feat_list, set it to True,
                    else set it to False
        return:
            -1, []: failed
            0, []: when is_end is True, return the mean and variance list
                   else return empty list
        """
    if self._calutlate_mean_variance_start == True:
      self._meam_variance_list = [
          0,
          np.zeros([feat_list[0][1].shape[1]]),
          np.zeros([feat_list[0][1].shape[1]])
      ]
      self._calutlate_mean_variance_start = False

    for tmp_feat_list in feat_list:
      self._meam_variance_list[0] += tmp_feat_list[1].shape[0]
      self._meam_variance_list[1] += np.sum(tmp_feat_list[1], axis=0)
      self._meam_variance_list[2] += (
          np.sum(np.multiply(tmp_feat_list[1], tmp_feat_list[1]), axis=0))

    if is_end:
      self._calutlate_mean_variance_start = True
      final_mean = self._meam_variance_list[1] / self._meam_variance_list[0]
      final_variance = (
          self._meam_variance_list[2] / self._meam_variance_list[0] -
          np.multiply(final_mean, final_mean))
      output_list = [["mean", final_mean], ["variance", final_variance]]
      return 0, output_list
    return 0, []
def calculate_mean_variance ( self , feat_list , is_end = False ) : if self . _calutlate_mean_variance_start == True : self . _meam_variance_list = [ 0 , np . zeros ( [ feat_list [ 0 ] [ 1 ] . shape [ 1 ] ] ) , np . zeros ( [ feat_list [ 0 ] [ 1 ] . shape [ 1 ] ] ) ] self . _calutlate_mean_variance_start = False for tmp_feat_list in feat_list : self . _meam_variance_list [ 0 ] += tmp_feat_list [ 1 ] . shape [ 0 ] self . _meam_variance_list [ 1 ] += np . sum ( tmp_feat_list [ 1 ] , axis = 0 ) self . _meam_variance_list [ 2 ] += ( np . sum ( np . multiply ( tmp_feat_list [ 1 ] , tmp_feat_list [ 1 ] ) , axis = 0 ) ) if is_end : self . _calutlate_mean_variance_start = True final_mean = self . _meam_variance_list [ 1 ] / self . _meam_variance_list [ 0 ] final_variance = ( self . _meam_variance_list [ 2 ] / self . _meam_variance_list [ 0 ] - np . multiply ( final_mean , final_mean ) ) output_list = [ [ "mean" , final_mean ] , [ "variance" , final_variance ] ] return 0 , output_list return 0 , [ ]