code: def quantization_error(self, X, batch_size=1):
          
          dist = self.transform(X, batch_size)
          res = dist.__getattribute__(self.valfunc)(1)
  
          return res
docs: Calculate the quantization error.
  
          Find the the minimum euclidean distance between the units and
          some input.
  
          Parameters
          ----------
          X : numpy array.
              The input data.
          batch_size : int
              The batch size to use for processing.
  
          Returns
          -------
          error : numpy array
              The error for each data point.