original_docstring: Get metrics for evaluating the model.
  
          Downstream models should override this method if they would like to
          add task-specific metrics.
  
          Args:
              train (bool): a boolean flag to indicate whether to return
                  training or validation metrics.
  
          .. warning:: If train=True, then it might calculate the training loss twice if
                       algorithms are overriding the loss fn. This could be expensive due
                       to the computational cost of softmax; it is worth exploring caching strategies.
  
          Returns:
              A  Metrics object that can be used to calculate task performance.
          
docstring: Get metrics for evaluating the model.
  Downstream models should override this method if they would like to
  add task-specific metrics.
docstring_tokens: Get metrics for evaluating the model . Downstream models should override this method if they would like to add task - specific metrics .
code: def metrics(self, train: bool = False) -> Metrics:
          """Get metrics for evaluating the model.
  
          Downstream models should override this method if they would like to
          add task-specific metrics.
  
          Args:
              train (bool): a boolean flag to indicate whether to return
                  training or validation metrics.
  
          .. warning:: If train=True, then it might calculate the training loss twice if
                       algorithms are overriding the loss fn. This could be expensive due
                       to the computational cost of softmax; it is worth exploring caching strategies.
  
          Returns:
              A  Metrics object that can be used to calculate task performance.
          """
          return self.train_loss if train else self.val_loss
code_tokens: def metrics ( self , train : bool = False ) -> Metrics : return self . train_loss if train else self . val_loss
short_docstring: Get metrics for evaluating the model.
short_docstring_tokens: Get metrics for evaluating the model .
comment: """Get metrics for evaluating the model.
  
          Downstream models should override this method if they would like to
          add task-specific metrics.
  
          Args:
              train (bool): a boolean flag to indicate whether to return
                  training or validation metrics.
  
          .. warning:: If train=True, then it might calculate the training loss twice if
                       algorithms are overriding the loss fn. This could be expensive due
                       to the computational cost of softmax; it is worth exploring caching strategies.
  
          Returns:
              A  Metrics object that can be used to calculate task performance.
          """