def free_energy(self, X):
        """
        .. todo::

            WRITEME properly

        This dataset can generate an infinite amount of examples.
        This function gives the energy function for the distribution from
        which the examples are drawn.
        """
        x = X[:, 0]
        y = X[:, 1]
        rval = T.sqr(y - T.cos(x)) / (2. * (self.std ** 2.))
        mask = x < self.max_x
        mask = mask * (x > self.min_x)
        rval = mask * rval + (1 - mask) * 1e30
        return rval
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/datasets/cos_dataset.py/CosDataset.free_energy/original