class_docstr: RLRMC algorithm implementation.
class_docstr_tok: ["RLRMC","algorithm","implementation","."]
code: def _cost(
      self,
      weights,
      entries_train_csr_data,
      entries_train_csr_indices,
      entries_train_csr_indptr,
      residual_global,
  ):
      U1 = weights[0]
      U2 = weights[1]
      B = weights[2]
      U1_dot_B = np.dot(U1, B)
      RLRMCalgorithm._computeLoss_csrmatrix(
          U1_dot_B,
          U2.T,
          entries_train_csr_data,
          entries_train_csr_indices,
          entries_train_csr_indptr,
          residual_global,
      )
      objective = 0.5 * np.sum(
          (residual_global) ** 2
      ) + 0.5 * self.C * np.sum(B**2)
      return objective
  
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 7 for calling the RLRMCalgorithm obj's underlying member method code with example usage: obj._cost(weights, entries_train_csr_data, entries_train_csr_indices, entries_train_csr_indptr, residual_global) and returns: objective