class_docstr: RLRMC algorithm implementation.
class_docstr_tok: ["RLRMC","algorithm","implementation","."]
code: def _my_stats(
      self,
      weights,
      given_stats,
      stats,
      residual_global,
      entries_validation_csr_data=None,
      entries_validation_csr_indices=None,
      entries_validation_csr_indptr=None,
      residual_validation_global=None,
  ):
      iteration = given_stats[0]
      cost = given_stats[1]
      gradnorm = given_stats[2]
      time_iter = given_stats[3]
      stats.setdefault("iteration", []).append(iteration)
      stats.setdefault("time", []).append(time_iter)
      stats.setdefault("objective", []).append(cost)
      stats.setdefault("gradnorm", []).append(gradnorm)
      U1 = weights[0]
      U2 = weights[1]
      B = weights[2]
      U1_dot_B = np.dot(U1, B)
      train_mse = np.mean(residual_global**2)
      train_rmse = sqrt(train_mse)
      stats.setdefault("trainRMSE", []).append(train_rmse)
      # Prediction
      if entries_validation_csr_data is not None:
          RLRMCalgorithm._computeLoss_csrmatrix(
              U1_dot_B,
              U2.T,
              entries_validation_csr_data,
              entries_validation_csr_indices,
              entries_validation_csr_indptr,
              residual_validation_global,
          )
          validation_mse = np.mean(residual_validation_global**2)
          validation_rmse = sqrt(validation_mse)
          stats.setdefault("validationRMSE", []).append(validation_rmse)
          logger.info(
              "Train RMSE: %.4f, Validation RMSE: %.4f, Total time: %.2f"
              % (train_rmse, validation_rmse, time_iter)
          )
      else:
          logger.info(
              "Train RMSE: %.4f, Total time: %.2f"
              % (train_rmse, time_iter)
          )
      return
  
imports: import numpy
  import logging
  from pymanopt import Problem
  from recommenders.models.rlrmc.conjugate_gradient_ms import ConjugateGradientMS
  from pymanopt.solvers.linesearch import LineSearchBackTracking
  from pymanopt.manifolds import Stiefel, SymmetricPositiveDefinite, Product
  from math import sqrt
  from scipy.sparse import csr_matrix
  from scipy.sparse.linalg import svds
  from numba import njit, prange
label_desc: Use image node_id 6 for calling the RLRMCalgorithm obj's underlying member method code with example usage: obj._my_stats(weights, given_stats, stats, residual_global, entries_validation_csr_data, entries_validation_csr_indices, entries_validation_csr_indptr, residual_validation_global) without return types