parameters: (self, *inputs)
docstring: Updates the internal evaluation result with `y_pred` and `y`.
  
          Args:
              inputs: Input `y_pred` and `y`. `y_pred` and `y` are a `Tensor`, a list or an array.
                  For 'classification' evaluation type, `y_pred` is in most cases (not strictly) a list
                  of floating numbers in range :math:`[0, 1]`
                  and the shape is :math:`(N, C)`, where :math:`N` is the number of cases and :math:`C`
                  is the number of categories. Shape of `y` can be :math:`(N, C)` with values 0 and 1 if one-hot
                  encoding is used or the shape is :math:`(N,)` with integer values if index of category is used.
                  For 'multilabel' evaluation type, `y_pred` and `y` can only be one-hot encoding with
                  values 0 or 1. Indices with 1 indicate positive category. The shape of `y_pred` and `y`
                  are both :math:`(N, C)`.
  
  
          Raises:
              ValueError: If the number of inputs is not 2.
docstring_summary: Updates the internal evaluation result with `y_pred` and `y`.
docstring_tokens: Updates the internal evaluation result with y_pred and y .
function: def update(self, *inputs):
          """
          Updates the internal evaluation result with `y_pred` and `y`.
  
          Args:
              inputs: Input `y_pred` and `y`. `y_pred` and `y` are a `Tensor`, a list or an array.
                  For 'classification' evaluation type, `y_pred` is in most cases (not strictly) a list
                  of floating numbers in range :math:`[0, 1]`
                  and the shape is :math:`(N, C)`, where :math:`N` is the number of cases and :math:`C`
                  is the number of categories. Shape of `y` can be :math:`(N, C)` with values 0 and 1 if one-hot
                  encoding is used or the shape is :math:`(N,)` with integer values if index of category is used.
                  For 'multilabel' evaluation type, `y_pred` and `y` can only be one-hot encoding with
                  values 0 or 1. Indices with 1 indicate positive category. The shape of `y_pred` and `y`
                  are both :math:`(N, C)`.
  
  
          Raises:
              ValueError: If the number of inputs is not 2.
          """
          if len(inputs) != 2:
              raise ValueError("For 'Recall.update', it needs 2 inputs (predicted value, true value), "
                               "but got {}.".format(len(inputs)))
          y_pred = self._convert_data(inputs[0])
          y = self._convert_data(inputs[1])
          if self._type == 'classification' and y_pred.ndim == y.ndim and self._check_onehot_data(y):
              y = y.argmax(axis=1)
          self._check_shape(y_pred, y)
          self._check_value(y_pred, y)
  
          if self._class_num == 0:
              self._class_num = y_pred.shape[1]
          elif y_pred.shape[1] != self._class_num:
              raise ValueError("For 'Recall.update', class number not match, last input predicted data contain {} "
                               "classes, but current predicted data contain {} classes, please check your predicted "
                               "value(inputs[0]).".format(self._class_num, y_pred.shape[1]))
  
          class_num = self._class_num
          if self._type == "classification":
              if y.max() + 1 > class_num:
                  raise ValueError("For 'Recall.update', predicted value (input[0]) should have the same classes number "
                                   "as true value (input[1]), but got predicted value classes {}, true value classes {}."
                                   .format(class_num, y.max() + 1))
              y = np.eye(class_num)[y.reshape(-1)]
              indices = y_pred.argmax(axis=1).reshape(-1)
              y_pred = np.eye(class_num)[indices]
          elif self._type == "multilabel":
              y_pred = y_pred.swapaxes(1, 0).reshape(class_num, -1)
              y = y.swapaxes(1, 0).reshape(class_num, -1)
  
          actual_positives = y.sum(axis=0)
          true_positives = (y * y_pred).sum(axis=0)
  
          if self._type == "multilabel":
              self._true_positives_average += np.sum(true_positives / (actual_positives + self.eps))
              self._actual_positives_average += len(actual_positives)
              self._true_positives = np.concatenate((self._true_positives, true_positives), axis=0)
              self._actual_positives = np.concatenate((self._actual_positives, actual_positives), axis=0)
          else:
              self._true_positives += true_positives
              self._actual_positives += actual_positives
function_tokens: def update ( self , * inputs ) : if len ( inputs ) != 2 : raise ValueError ( "For 'Recall.update', it needs 2 inputs (predicted value, true value), " "but got {}." . format ( len ( inputs ) ) ) y_pred = self . _convert_data ( inputs [ 0 ] ) y = self . _convert_data ( inputs [ 1 ] ) if self . _type == 'classification' and y_pred . ndim == y . ndim and self . _check_onehot_data ( y ) : y = y . argmax ( axis = 1 ) self . _check_shape ( y_pred , y ) self . _check_value ( y_pred , y ) if self . _class_num == 0 : self . _class_num = y_pred . shape [ 1 ] elif y_pred . shape [ 1 ] != self . _class_num : raise ValueError ( "For 'Recall.update', class number not match, last input predicted data contain {} " "classes, but current predicted data contain {} classes, please check your predicted " "value(inputs[0])." . format ( self . _class_num , y_pred . shape [ 1 ] ) ) class_num = self . _class_num if self . _type == "classification" : if y . max ( ) + 1 > class_num : raise ValueError ( "For 'Recall.update', predicted value (input[0]) should have the same classes number " "as true value (input[1]), but got predicted value classes {}, true value classes {}." . format ( class_num , y . max ( ) + 1 ) ) y = np . eye ( class_num ) [ y . reshape ( - 1 ) ] indices = y_pred . argmax ( axis = 1 ) . reshape ( - 1 ) y_pred = np . eye ( class_num ) [ indices ] elif self . _type == "multilabel" : y_pred = y_pred . swapaxes ( 1 , 0 ) . reshape ( class_num , - 1 ) y = y . swapaxes ( 1 , 0 ) . reshape ( class_num , - 1 ) actual_positives = y . sum ( axis = 0 ) true_positives = ( y * y_pred ) . sum ( axis = 0 ) if self . _type == "multilabel" : self . _true_positives_average += np . sum ( true_positives / ( actual_positives + self . eps ) ) self . _actual_positives_average += len ( actual_positives ) self . _true_positives = np . concatenate ( ( self . _true_positives , true_positives ) , axis = 0 ) self . _actual_positives = np . concatenate ( ( self . _actual_positives , actual_positives ) , axis = 0 ) else : self . _true_positives += true_positives self . _actual_positives += actual_positives