class_docstr: Mixin utility for training loss methods for models that own their own data. It provides
  
    - a uniform API for the training loss :meth:`training_loss`
    - a convenience method :meth:`training_loss_closure` for constructing the closure expected by
      various optimizers, namely :class:`gpflow.optimizers.Scipy` and subclasses of
      `tf.optimizers.Optimizer`.
  
  See :class:`ExternalDataTrainingLossMixin` for an equivalent mixin for models that do **not**
  own their own data.
class_docstr_tok: ["Mixin","utility","for","training","loss","methods","for","models","that","own","their","own","data",".","It","provides","-","a","uniform","API","for","the","training","loss",":","meth",":","`","training_loss","`","-","a","convenience","method",":","meth",":","`","training_loss_closure","`","for","constructing","the","closure","expected","by","various","optimizers",",","namely",":","class",":","`","gpflow.optimizers.Scipy","`","and","subclasses","of","`","tf.optimizers.Optimizer","`",".","See",":","class",":","`","ExternalDataTrainingLossMixin","`","for","an","equivalent","mixin","for","models","that","do","*","*","not","*","*","own","their","own","data","."]
docstr: Returns the training loss for this model.
docstr_tok: ["Returns","the","training","loss","for","this","model","."]
code: def training_loss(self) -> tf.Tensor:
      """
      Returns the training loss for this model.
      """
      # Type-ignore is because _training_loss should be added by implementing class.
      return self._training_loss()
  
file_path: GPflow/gpflow/models/training_mixins.py
imports: from typing import Callable, TypeVar, Union
  import tensorflow
  from check_shapes import check_shapes
  from tensorflow.python.data.ops.iterator_ops import OwnedIterator
  from ..base import InputData, OutputData, RegressionData
label_desc: Use image node_id 1 for calling the InternalDataTrainingLossMixin obj's underlying member method code with example usage: obj.training_loss() and returns: self