tyxe/likelihoods.py
def forward(self, predictions, obs=None):
        """Executes a pyro sample statement to sample from the distribution corresponding to the likelihood class
        given some predictions. The values of the sample can set to some optional observations obs.

        :param torch.Tensor predictions: tensor of predictions.
        :param torch.Tensor obs: optional known values for the samples."""
        predictive_distribution = self.predictive_distribution(predictions)
        if predictive_distribution.batch_shape:
            dataset_size = self.dataset_size if self.dataset_size is not None else len(predictions)
            with pyro.plate(self.data_name+"_plate", subsample=predictions, size=dataset_size):
                return pyro.sample(self.data_name, predictive_distribution, obs=obs)
        else:
            dataset_size = self.dataset_size if self.dataset_size is not None else 1
            with pyro.poutine.scale(scale=dataset_size):
                return pyro.sample(self.data_name, predictive_distribution, obs=obs)
Executes a pyro sample statement to sample from the distribution corresponding to the likelihood class
        given some predictions. The values of the sample can set to some optional observations obs.

        :param torch.Tensor predictions: tensor of predictions.
        :param torch.Tensor obs: optional known values for the samples.
Executes a pyro sample statement to sample from the distribution corresponding to the likelihood class
given some predictions. The values of the sample can set to some optional observations obs.
Executes a pyro sample statement to sample from the distribution corresponding to the likelihood class given some predictions . The values of the sample can set to some optional observations obs .
def forward(self, predictions, obs=None):
        predictive_distribution = self.predictive_distribution(predictions)
        if predictive_distribution.batch_shape:
            dataset_size = self.dataset_size if self.dataset_size is not None else len(predictions)
            with pyro.plate(self.data_name+"_plate", subsample=predictions, size=dataset_size):
                return pyro.sample(self.data_name, predictive_distribution, obs=obs)
        else:
            dataset_size = self.dataset_size if self.dataset_size is not None else 1
            with pyro.poutine.scale(scale=dataset_size):
                return pyro.sample(self.data_name, predictive_distribution, obs=obs)
def forward ( self , predictions , obs = None ) : predictive_distribution = self . predictive_distribution ( predictions ) if predictive_distribution . batch_shape : dataset_size = self . dataset_size if self . dataset_size is not None else len ( predictions ) with pyro . plate ( self . data_name + "_plate" , subsample = predictions , size = dataset_size ) : return pyro . sample ( self . data_name , predictive_distribution , obs = obs ) else : dataset_size = self . dataset_size if self . dataset_size is not None else 1 with pyro . poutine . scale ( scale = dataset_size ) : return pyro . sample ( self . data_name , predictive_distribution , obs = obs )
Executes a pyro sample statement to sample from the distribution corresponding to the likelihood class
given some predictions.
Executes a pyro sample statement to sample from the distribution corresponding to the likelihood class given some predictions .
"""Executes a pyro sample statement to sample from the distribution corresponding to the likelihood class
        given some predictions. The values of the sample can set to some optional observations obs.

        :param torch.Tensor predictions: tensor of predictions.
        :param torch.Tensor obs: optional known values for the samples."""
self
predictions
tensor of predictions.
tensor of predictions .
obs
optional known values for the samples.
optional known values for the samples .