(self, weights, y)
return -crets[:, -1]
Compute negative simple cumulative returns.

        Parameters
        ----------
        weights : torch.Tensor
            Tensor of shape `(n_samples, n_assets)` representing the predicted weights by our portfolio optimizer.

        y : torch.Tensor
            Tensor of shape `(n_samples, n_channels, horizon, n_assets)` representing the evolution over the next
            `horizon` timesteps.

        Returns
        -------
        torch.Tensor
            Tensor of shape `(n_samples,)` representing the per sample negative simple cumulative returns.
Compute negative simple cumulative returns.
Compute negative simple cumulative returns .
def __call__(self, weights, y):
        """Compute negative simple cumulative returns.

        Parameters
        ----------
        weights : torch.Tensor
            Tensor of shape `(n_samples, n_assets)` representing the predicted weights by our portfolio optimizer.

        y : torch.Tensor
            Tensor of shape `(n_samples, n_channels, horizon, n_assets)` representing the evolution over the next
            `horizon` timesteps.

        Returns
        -------
        torch.Tensor
            Tensor of shape `(n_samples,)` representing the per sample negative simple cumulative returns.

        """
        crets = portfolio_cumulative_returns(weights,
                                             y[:, self.returns_channel, ...],
                                             input_type=self.input_type,
                                             output_type='simple')

        return -crets[:, -1]
def __call__ ( self , weights , y ) : crets = portfolio_cumulative_returns ( weights , y [ : , self . returns_channel , ... ] , input_type = self . input_type , output_type = 'simple' ) return - crets [ : , - 1 ]