'Fit the model to the data X which should contain a partial
segment of the data.
Parameters
X : array-like, shape (n_samples, n_features)
Training data.
Returns
self : BernoulliRBM
The fitted model.'

def partial_fit(self, X, y=None):

    X = check_array(X, accept_sparse='csr', dtype=np.float64)
    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')
    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_)
