dacapo.experiments.tasks.losses.mse_loss ======================================== .. py:module:: dacapo.experiments.tasks.losses.mse_loss Classes ------- .. autoapisummary:: dacapo.experiments.tasks.losses.mse_loss.MSELoss Module Contents --------------- .. py:class:: MSELoss A class used to represent the Mean Square Error Loss function (MSELoss). This class inherits from the Loss class. .. method:: compute(prediction, target, weight) -> torch.Tensor Function to compute the MSELoss for the provided prediction and target, with respect to the weight. .. note:: This class is abstract. Subclasses must implement the abstract methods. Once created, the values of its attributes cannot be changed. .. py:method:: compute(prediction, target, weight) Function to compute the MSELoss for the provided prediction and target, with respect to the weight. :param prediction: torch.Tensor The predicted tensor. :param target: torch.Tensor The target tensor. :param weight: torch.Tensor The weight tensor. :returns: torch.Tensor The computed MSELoss tensor. :raises NotImplementedError: If the method is not implemented in the subclass. .. rubric:: Examples >>> loss = MSELoss() >>> prediction = torch.tensor([1.0, 2.0, 3.0]) >>> target = torch.tensor([1.0, 2.0, 3.0]) >>> weight = torch.tensor([1.0, 1.0, 1.0]) >>> loss.compute(prediction, target, weight) tensor(0.) .. note:: This method must be implemented in the subclass. It should return the computed MSELoss tensor.