code: def recon_err(data, F, W):
      
  
      recon = F.dot(W).ravel()
      err = mean_squared_error(
          data.ravel(),
          recon,
          multioutput='uniform_average')
      return math.sqrt(err)
docs: Calcuate reconstruction error
  
      Parameters
      ----------
  
      data : 2D array 
          True data to recover.
  
      F : 2D array 
          HTFA factor matrix.
  
      W : 2D array 
          HTFA weight matrix.
     
  
      Returns
      -------
      float 
          Returns root mean squared reconstruction error.