Or better, pass the random state as an argument to the method.
On May 7, 2013 6:33 AM, "Gael Varoquaux" <notifications@github.com> wrote:

> In sklearn/neural_network/rbm.py:
>
> > +        Compute the element-wise binomial using the probabilities p.
> > +
> > +        Parameters
> > +        ----------
> > +        x: array-like, shape (M, N)
> > +
> > +        Notes
> > +        -----
> > +        This is equivalent to calling numpy.random.binomial(1, p) but is
> > +        faster because it uses in-place operations on p.
> > +
> > +        Returns
> > +        -------
> > +        x_new: array-like, shape (M, N)
> > +        """
> > +        p[self.random_state.uniform(size=p.shape) < p] = 1.
>
> self.random_state cannot be a rng object, because it would mean modifying
> the input parameter. You need to create a shadow self.random_state_ object,
> as done in the other learners.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/scikit-learn/scikit-learn/pull/1200/files#r4102207>
> .
>