code: def train(self, features, targets):
      
      (numSamples, numOutputs) = targets.shape
      assert features.shape[0] == targets.shape[0]
  
      H = self.calculateHiddenLayerActivation(features)
      Ht = np.transpose(H)
      try:
        self.M -= np.dot(self.M,
                         np.dot(Ht, np.dot(
            pinv(np.eye(numSamples) + np.dot(H, np.dot(self.M, Ht))),
            np.dot(H, self.M))))
  
        self.beta += np.dot(self.M, np.dot(Ht, targets - np.dot(H, self.beta)))
      except np.linalg.linalg.LinAlgError:
        print "SVD not converge, ignore the current training cycle"
docs: Step 2: Sequential learning phase
      :param features feature matrix with dimension (numSamples, numInputs)
      :param targets target matrix with dimension (numSamples, numOutputs)