On Thu, Jan 24, 2013 at 1:53 PM, Gael Varoquaux <notifications@github.com>wrote:

> In sklearn/neural_networks/rbm.py:
>
> > +        Computes the free energy
> > +        ``\mathcal{F}({\bf v}) = - \log \sum_{\bf h} e^{-E({\bf v},{\bf h})}``.
> > +
> > +        Parameters
> > +        ----------
> > +        v: array-like, shape (n_samples, n_features)
> > +
> > +        Returns
> > +        -------
> > +        free_energy: array-like, shape (n_samples,)
> > +        """
> > +        return - np.dot(v, self.intercept_visible_) - np.log(1. + np.exp(
> > +            safe_sparse_dot(v, self.components_.T) + self.intercept_hidden_)) \
> > +            .sum(axis=1)
> > +
> > +    def gibbs(self, v):
>
> If I am not mistaken, the corresponding method in GMMs (mixture/gmm.py) is
> called 'sample'. It would be useful to have the same name for API
> consistency.
>
$0.02: I don't think it's necessarily a good idea to conflate the two.

My reasoning: `sample()`, I'm pretty sure, draws an independent sample from
the model distribution. This is impossible with an RBM. This executes one
step of a Gibbs sampling process, requires an initial visible state, and
importantly does *not* yield independent samples on successive calls.