code: def get_train_err(htfa, data, F):
      
  
      W = htfa.get_weights(data, F)
      return recon_err(data, F, W)
docs: Calcuate training error
  
      Parameters
      ----------
  
      htfa : HTFA
          An instance of HTFA, factor anaysis class in BrainIAK.
     
      data : 2D array 
          Input data to HTFA.
  
      F : 2D array 
          HTFA factor matrix.
          
      Returns
      -------
      float 
          Returns root mean squared error on training.