Пример #1
0
    def __init__(self, sigma=0.5, D=2, sep=8):

        assert D >= 2
        
        self.sigma = sigma
        self.D = D
        self.name  = "grid"
        self.has_grad = True
        np.random.seed(1)
        self._g = GaussianGrid(D, sigma, sep=sep)
Пример #2
0
class Grid(ToyDataset):
    def __init__(self, sigma=0.5, D=2, sep=8):

        assert D >= 2

        self.sigma = sigma
        self.D = D
        self.name = "grid"
        self.has_grad = True
        np.random.seed(1)
        self._g = GaussianGrid(D, sigma, sep=sep)

    def grad_multiple(self, X):
        return self._g.grad_multiple(X)

    def logpdf_multiple(self, X):
        return self._g.log_pdf_multiple(X)

    def sample(self, N):
        return self._g.sample(N)