<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def train(self, inputData, numIterations, reset=False):
 """ Trains the SparseNet, with the provided data. The reset parameter can be set to False if the network should not be reset before training (for example for continuing a previous started training). :param inputData: (array) Input data, of dimension (inputDim, numPoints) :param numIterations: (int) Number of training iterations :param reset: (bool) If set to True, reset basis and history """

    if not isinstance(inputData, np.ndarray):
      inputData = np.array(inputData)

    if reset:
      self._reset()

    for _ in xrange(numIterations):
      self._iteration += 1

      batch = self._getDataBatch(inputData)

      # check input dimension, change if necessary
      if batch.shape[0] != self.filterDim:
        raise ValueError("Batches and filter dimesions don't match!")

      activations = self.encode(batch)
      self._learn(batch, activations)

      if self._iteration % self.decayCycle == 0:
        self.learningRate *= self.learningRateDecay

    if self.verbosity >= 1:
      self.plotLoss()
      self.plotBasis()