parameters: (self, mat_x, labels)
return_statement: return loss, grads
docstring: Calculates the loss of the current model for the given data, using a
      cross-entropy loss function.
  
      Args:
        mat_x (:obj:`numpy.ndarray`): The input data (image embeddings) to test, as a matrix of shape
          ``NxD``, where ``N`` is number of inputs to test and ``D`` is the dimension of the
          input feature (length of the feature vector).
        labels (:obj:`numpy.ndarray`): An array of the correct label indices that correspond to the
          test data passed in ``mat_x`` (class label index in one-hot vector). For example, if
          ``mat_x`` is just one image embedding, this array has one number for that image's correct
          label index.
  
      Returns:
        A 2-tuple with the cross-entropy loss (float) and gradients (a dictionary with ``'mat_w'``
        and ``'vec_b'``, for weight and bias, respectively).
docstring_summary: Calculates the loss of the current model for the given data, using a
      cross-entropy loss function.
docstring_tokens: Calculates the loss of the current model for the given data using a cross - entropy loss function .
function: def _get_loss(self, mat_x, labels):
      """Calculates the loss of the current model for the given data, using a
      cross-entropy loss function.
  
      Args:
        mat_x (:obj:`numpy.ndarray`): The input data (image embeddings) to test, as a matrix of shape
          ``NxD``, where ``N`` is number of inputs to test and ``D`` is the dimension of the
          input feature (length of the feature vector).
        labels (:obj:`numpy.ndarray`): An array of the correct label indices that correspond to the
          test data passed in ``mat_x`` (class label index in one-hot vector). For example, if
          ``mat_x`` is just one image embedding, this array has one number for that image's correct
          label index.
  
      Returns:
        A 2-tuple with the cross-entropy loss (float) and gradients (a dictionary with ``'mat_w'``
        and ``'vec_b'``, for weight and bias, respectively).
      """
      mat_w = self.params['mat_w']
      vec_b = self.params['vec_b']
      scores, fc_cached = ops.fc_forward(mat_x, mat_w, vec_b)
      # Record min, max value of scores.
      self.min_score = np.min([self.min_score, np.min(scores)])
      self.max_score = np.max([self.max_score, np.max(scores)])
      loss, dscores = ops.softmax_cross_entropy_loss(scores, labels)
      loss += 0.5 * self.reg * np.sum(mat_w * mat_w)
  
      grads = {}
      _, grads['mat_w'], grads['vec_b'] = ops.fc_backward(dscores, fc_cached)
      grads['mat_w'] += self.reg * mat_w
  
      return loss, grads
function_tokens: def _get_loss ( self , mat_x , labels ) : mat_w = self . params [ 'mat_w' ] vec_b = self . params [ 'vec_b' ] scores , fc_cached = ops . fc_forward ( mat_x , mat_w , vec_b ) # Record min, max value of scores. self . min_score = np . min ( [ self . min_score , np . min ( scores ) ] ) self . max_score = np . max ( [ self . max_score , np . max ( scores ) ] ) loss , dscores = ops . softmax_cross_entropy_loss ( scores , labels ) loss += 0.5 * self . reg * np . sum ( mat_w * mat_w ) grads = { } _ , grads [ 'mat_w' ] , grads [ 'vec_b' ] = ops . fc_backward ( dscores , fc_cached ) grads [ 'mat_w' ] += self . reg * mat_w return loss , grads