class_docstr: Bernoulli Restricted Boltzmann Machine (RBM).
  
  A Restricted Boltzmann Machine with binary visible units and
  binary hidden units. Parameters are estimated using Stochastic Maximum
  Likelihood (SML), also known as Persistent Contrastive Divergence (PCD)
  [2].
  
  The time complexity of this implementation is ``O(d ** 2)`` assuming
  d ~ n_features ~ n_components.
  
  Read more in the :ref:`User Guide <rbm>`.
  
  Parameters
  ----------
  n_components : int, default=256
      Number of binary hidden units.
  
  learning_rate : float, default=0.1
      The learning rate for weight updates. It is *highly* recommended
      to tune this hyper-parameter. Reasonable values are in the
      10**[0., -3.] range.
  
  batch_size : int, default=10
      Number of examples per minibatch.
  
  n_iter : int, default=10
      Number of iterations/sweeps over the training dataset to perform
      during training.
  
  verbose : int, default=0
      The verbosity level. The default, zero, means silent mode. Range
      of values is [0, inf].
  
  random_state : int, RandomState instance or None, default=None
      Determines random number generation for:
  
      - Gibbs sampling from visible and hidden layers.
  
      - Initializing components, sampling from layers during fit.
  
      - Corrupting the data when scoring samples.
  
      Pass an int for reproducible results across multiple function calls.
      See :term:`Glossary <random_state>`.
  
  Attributes
  ----------
  intercept_hidden_ : array-like of shape (n_components,)
      Biases of the hidden units.
  
  intercept_visible_ : array-like of shape (n_features,)
      Biases of the visible units.
  
  components_ : array-like of shape (n_components, n_features)
      Weight matrix, where `n_features` is the number of
      visible units and `n_components` is the number of hidden units.
  
  h_samples_ : array-like of shape (batch_size, n_components)
      Hidden Activation sampled from the model distribution,
      where `batch_size` is the number of examples per minibatch and
      `n_components` is the number of hidden units.
  
  n_features_in_ : int
      Number of features seen during :term:`fit`.
  
      .. versionadded:: 0.24
  
  feature_names_in_ : ndarray of shape (`n_features_in_`,)
      Names of features seen during :term:`fit`. Defined only when `X`
      has feature names that are all strings.
  
      .. versionadded:: 1.0
  
  See Also
  --------
  sklearn.neural_network.MLPRegressor : Multi-layer Perceptron regressor.
  sklearn.neural_network.MLPClassifier : Multi-layer Perceptron classifier.
  sklearn.decomposition.PCA : An unsupervised linear dimensionality
      reduction model.
  
  References
  ----------
  
  [1] Hinton, G. E., Osindero, S. and Teh, Y. A fast learning algorithm for
      deep belief nets. Neural Computation 18, pp 1527-1554.
      https://www.cs.toronto.edu/~hinton/absps/fastnc.pdf
  
  [2] Tieleman, T. Training Restricted Boltzmann Machines using
      Approximations to the Likelihood Gradient. International Conference
      on Machine Learning (ICML) 2008
  
  Examples
  --------
  
  >>> import numpy as np
  >>> from sklearn.neural_network import BernoulliRBM
  >>> X = np.array([[0, 0, 0], [0, 1, 1], [1, 0, 1], [1, 1, 1]])
  >>> model = BernoulliRBM(n_components=2)
  >>> model.fit(X)
  BernoulliRBM(n_components=2)
class_docstr_tok: ["Bernoulli","Restricted","Boltzmann","Machine","(","RBM",")",".","A","Restricted","Boltzmann","Machine","with","binary","visible","units","and","binary","hidden","units",".","Parameters","are","estimated","using","Stochastic","Maximum","Likelihood","(","SML",")",",","also","known","as","Persistent","Contrastive","Divergence","(","PCD",")","[","2","]",".","The","time","complexity","of","this","implementation","is","``","O","(","d","*","*","2",")","``","assuming","d","~","n_features","~","n_components",".","Read","more","in","the",":","ref",":","`","User","Guide","<","rbm",">","`",".","Parameters","--","--","--","--","--","n_components",":","int",",","default=256","Number","of","binary","hidden","units",".","learning_rate",":","float",",","default=0.1","The","learning","rate","for","weight","updates",".","It","is","*","highly","*","recommended","to","tune","this","hyper-parameter",".","Reasonable","values","are","in","the","10","*","*","[","0.",",","-3",".","]","range",".","batch_size",":","int",",","default=10","Number","of","examples","per","minibatch",".","n_iter",":","int",",","default=10","Number","of","iterations\/sweeps","over","the","training","dataset","to","perform","during","training",".","verbose",":","int",",","default=0","The","verbosity","level",".","The","default",",","zero",",","means","silent","mode",".","Range","of","values","is","[","0",",","inf","]",".","random_state",":","int",",","RandomState","instance","or","None",",","default=None","Determines","random","number","generation","for",":","-","Gibbs","sampling","from","visible","and","hidden","layers",".","-","Initializing","components",",","sampling","from","layers","during","fit",".","-","Corrupting","the","data","when","scoring","samples",".","Pass","an","int","for","reproducible","results","across","multiple","function","calls",".","See",":","term",":","`","Glossary","<","random_state",">","`",".","Attributes","--","--","--","--","--","intercept_hidden_",":","array-like","of","shape","(","n_components",",",")","Biases","of","the","hidden","units",".","intercept_visible_",":","array-like","of","shape","(","n_features",",",")","Biases","of","the","visible","units",".","components_",":","array-like","of","shape","(","n_components",",","n_features",")","Weight","matrix",",","where","`","n_features","`","is","the","number","of","visible","units","and","`","n_components","`","is","the","number","of","hidden","units",".","h_samples_",":","array-like","of","shape","(","batch_size",",","n_components",")","Hidden","Activation","sampled","from","the","model","distribution",",","where","`","batch_size","`","is","the","number","of","examples","per","minibatch","and","`","n_components","`","is","the","number","of","hidden","units",".","n_features_in_",":","int","Number","of","features","seen","during",":","term",":","`","fit","`",".","..","versionadded",":",":","0.24","feature_names_in_",":","ndarray","of","shape","(","`","n_features_in_","`",",",")","Names","of","features","seen","during",":","term",":","`","fit","`",".","Defined","only","when","`","X","`","has","feature","names","that","are","all","strings",".","..","versionadded",":",":","1.0","See","Also","--","--","--","--","sklearn.neural_network.MLPRegressor",":","Multi-layer","Perceptron","regressor",".","sklearn.neural_network.MLPClassifier",":","Multi-layer","Perceptron","classifier",".","sklearn.decomposition.PCA",":","An","unsupervised","linear","dimensionality","reduction","model",".","References","--","--","--","--","--","[","1","]","Hinton",",","G.","E.",",","Osindero",",","S.","and","Teh",",","Y",".","A","fast","learning","algorithm","for","deep","belief","nets",".","Neural","Computation","18",",","pp","1527-1554.","https",":","\/\/www.cs.toronto.edu\/~hinton\/absps\/fastnc.pdf","[","2","]","Tieleman",",","T.","Training","Restricted","Boltzmann","Machines","using","Approximations","to","the","Likelihood","Gradient",".","International","Conference","on","Machine","Learning","(","ICML",")","2008","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","sklearn.neural_network","import","BernoulliRBM",">",">",">","X","=","np.array","(","[","[","0",",","0",",","0","]",",","[","0",",","1",",","1","]",",","[","1",",","0",",","1","]",",","[","1",",","1",",","1","]","]",")",">",">",">","model","=","BernoulliRBM","(","n_components=2",")",">",">",">","model.fit","(","X",")","BernoulliRBM","(","n_components=2",")"]
docstr: Fit the model to the partial segment of the data X.
  
  Parameters
  ----------
  X : ndarray of shape (n_samples, n_features)
      Training data.
  
  y : array-like of shape (n_samples,) or (n_samples, n_outputs), default=None
      Target values (None for unsupervised transformations).
  
  Returns
  -------
  self : BernoulliRBM
      The fitted model.
docstr_tok: ["Fit","the","model","to","the","partial","segment","of","the","data","X.","Parameters","--","--","--","--","--","X",":","ndarray","of","shape","(","n_samples",",","n_features",")","Training","data",".","y",":","array-like","of","shape","(","n_samples",",",")","or","(","n_samples",",","n_outputs",")",",","default=None","Target","values","(","None","for","unsupervised","transformations",")",".","Returns","--","--","--","-","self",":","BernoulliRBM","The","fitted","model","."]
code: def partial_fit(self, X, y=None):
      """Fit the model to the partial segment of the data X.
  
      Parameters
      ----------
      X : ndarray of shape (n_samples, n_features)
          Training data.
  
      y : array-like of shape (n_samples,) or (n_samples, n_outputs), default=None
          Target values (None for unsupervised transformations).
  
      Returns
      -------
      self : BernoulliRBM
          The fitted model.
      """
      first_pass = not hasattr(self, "components_")
      X = self._validate_data(
          X, accept_sparse="csr", dtype=np.float64, reset=first_pass
      )
      if not hasattr(self, "random_state_"):
          self.random_state_ = check_random_state(self.random_state)
      if not hasattr(self, "components_"):
          self.components_ = np.asarray(
              self.random_state_.normal(
                  0, 0.01, (self.n_components, X.shape[1])
              ),
              order="F",
          )
          self._n_features_out = self.components_.shape[0]
      if not hasattr(self, "intercept_hidden_"):
          self.intercept_hidden_ = np.zeros(
              self.n_components,
          )
      if not hasattr(self, "intercept_visible_"):
          self.intercept_visible_ = np.zeros(
              X.shape[1],
          )
      if not hasattr(self, "h_samples_"):
          self.h_samples_ = np.zeros(
              (self.batch_size, self.n_components)
          )
  
      self._fit(X, self.random_state_)
  
imports: import time
  from numbers import Integral, Real
  import numpy
  import scipy.sparse
  from scipy.special import expit
  from ..base import BaseEstimator, ClassNamePrefixFeaturesOutMixin, TransformerMixin, _fit_context
  from ..utils import check_random_state, gen_even_slices
  from ..utils._param_validation import Interval
  from ..utils.extmath import safe_sparse_dot
  from ..utils.validation import check_is_fitted
label_desc: Use image node_id 8 for calling the BernoulliRBM obj's underlying member method code with example usage: obj.partial_fit(X, y) without return types