(self, feat_array, delta_order=2, delta_window=2)
return 0, output_delta_feat
add delta to feat
        args:
            feat_array: input feat which is from one sentence
            delta_order: the order of delta
            delta_window: the window of delta
        return:
            -1, array: failed
            0, feat_array: success
add delta to feat
        args:
            feat_array: input feat which is from one sentence
            delta_order: the order of delta
            delta_window: the window of delta
        return:
            -1, array: failed
            0, feat_array: success
add delta to feat args : feat_array : input feat which is from one sentence delta_order : the order of delta delta_window : the window of delta return : - 1 array : failed 0 feat_array : success
def add_delta(self, feat_array, delta_order=2, delta_window=2):
    """
        add delta to feat
        args:
            feat_array: input feat which is from one sentence
            delta_order: the order of delta
            delta_window: the window of delta
        return:
            -1, array: failed
            0, feat_array: success
        """
    if self._delta_normalizer == 0 or self._delta_window != delta_window:
      self._compute_delta_normalizer(delta_window)

    frame_num, feat_dim = feat_array.shape
    tmp_output_delta_feat = [feat_array]
    for _ in range(1, delta_order + 1):
      tmp_delta_feat = np.zeros([frame_num, feat_dim])
      for tmp_frame_num in range(frame_num):
        tmp_action_frame_begin = tmp_frame_num - delta_window
        tmp_action_frame_end = tmp_frame_num + delta_window
        if tmp_action_frame_begin < 0 or tmp_action_frame_end >= frame_num:
          for tmp_detal_window in range(-1 * delta_window, delta_window + 1):
            tmp_action_frame = tmp_frame_num + tmp_detal_window
            if tmp_action_frame < 0:
              tmp_action_frame = 0
              fill_status = True
            if tmp_action_frame >= frame_num:
              tmp_action_frame = frame_num - 1
              fill_status = True

            tmp_delta_feat[tmp_frame_num] += (
                tmp_detal_window * tmp_output_delta_feat[-1][tmp_action_frame])

          tmp_delta_feat[tmp_frame_num] = (
              tmp_delta_feat[tmp_frame_num] * self._delta_normalizer)
        else:
          tmp_delta_feat[tmp_frame_num] = (
              np.sum(
                  (tmp_output_delta_feat[-1]
                   [tmp_action_frame_begin:tmp_action_frame_end + 1].T *
                   self._delta_window_array).T,
                  axis=0))
      tmp_output_delta_feat.append(tmp_delta_feat)
    output_delta_feat = np.hstack(tmp_output_delta_feat)
    return 0, output_delta_feat
def add_delta ( self , feat_array , delta_order = 2 , delta_window = 2 ) : if self . _delta_normalizer == 0 or self . _delta_window != delta_window : self . _compute_delta_normalizer ( delta_window ) frame_num , feat_dim = feat_array . shape tmp_output_delta_feat = [ feat_array ] for _ in range ( 1 , delta_order + 1 ) : tmp_delta_feat = np . zeros ( [ frame_num , feat_dim ] ) for tmp_frame_num in range ( frame_num ) : tmp_action_frame_begin = tmp_frame_num - delta_window tmp_action_frame_end = tmp_frame_num + delta_window if tmp_action_frame_begin < 0 or tmp_action_frame_end >= frame_num : for tmp_detal_window in range ( - 1 * delta_window , delta_window + 1 ) : tmp_action_frame = tmp_frame_num + tmp_detal_window if tmp_action_frame < 0 : tmp_action_frame = 0 fill_status = True if tmp_action_frame >= frame_num : tmp_action_frame = frame_num - 1 fill_status = True tmp_delta_feat [ tmp_frame_num ] += ( tmp_detal_window * tmp_output_delta_feat [ - 1 ] [ tmp_action_frame ] ) tmp_delta_feat [ tmp_frame_num ] = ( tmp_delta_feat [ tmp_frame_num ] * self . _delta_normalizer ) else : tmp_delta_feat [ tmp_frame_num ] = ( np . sum ( ( tmp_output_delta_feat [ - 1 ] [ tmp_action_frame_begin : tmp_action_frame_end + 1 ] . T * self . _delta_window_array ) . T , axis = 0 ) ) tmp_output_delta_feat . append ( tmp_delta_feat ) output_delta_feat = np . hstack ( tmp_output_delta_feat ) return 0 , output_delta_feat