code: def train(self, params):
      
      # self.net = buildNetwork(params['encoding_num'] * params['num_lags'],
      #                         params['num_cells'],
      #                         params['encoding_num'],
      #                         bias=True,
      #                         outputbias=True)
  
      ds = SupervisedDataSet(params['encoding_num'] * params['num_lags'],
                             params['encoding_num'])
      history = self.window(self.history, params['learning_window'])
  
      n = params['encoding_num']
      for i in xrange(params['num_lags'], len(history)):
        targets = numpy.zeros((1, n))
        targets[0, :] = self.encoder.encode(history[i])
  
        features = numpy.zeros((1, n * params['num_lags']))
        for lags in xrange(params['num_lags']):
          features[0, lags * n:(lags + 1) * n] = self.encoder.encode(
            history[i - (lags + 1)])
        ds.addSample(features, targets)
  
      trainer = BackpropTrainer(self.net,
                                dataset=ds,
                                verbose=params['verbosity'] > 0)
  
      if len(history) > 1:
        trainer.trainEpochs(params['num_epochs'])
docs: Train TDNN network on buffered dataset history
      :param params:
      :return: