def fit(self, data):
        n, m = data.shape
        num_batches = n / self.batch_size
        e = 0
        
        if self.verbose: 
            start_time = time.clock()
        
        while e < self.epochs:
            e += 1
            batches = make_batches(data, self.batch_size)
            for i, (batch, subsample_ids) in enumerate(batches):
                cost, grad = self.cost(batch, subsample_ids)
                self = self.update(grad, subsample_ids)
                self.cost_hist.append(cost)
                if self.verbose:
                    print 'Batch %i - Cost %0.6f\r'%(i+1, cost),
                    stdout.flush()
            if self.verbose:
                print 'Training Epoch %i'%(self.total_epochs), 
                print 'Average Cost: %0.6f\t\t'%np.mean(self.cost_hist[-num_batches:])
                stdout.flush()
            self.total_epochs += 1
            
        if self.verbose: 
            end_time = time.clock()
            print 'Runtime %0.2fs'%(end_time-start_time)
            
        return self
Trains the RBM using stochastic gradient descent for self.epochs 
dataset/ETHPy150Open theusual/kaggle-seeclickfix-ensemble/Miroslaw/sparserbm.py/SparseRBM.fit