class_docstr: RaCT is a collaborative filtering model which uses methods based on actor-critic reinforcement learning for training.
  
  We implement the RaCT model with only user dataloader.
class_docstr_tok: ["RaCT","is","a","collaborative","filtering","model","which","uses","methods","based","on","actor-critic","reinforcement","learning","for","training",".","We","implement","the","RaCT","model","with","only","user","dataloader","."]
code: def calculate_actor_loss(self, interaction):
      user = interaction[self.USER_ID]
      rating_matrix = self.get_rating_matrix(user)
  
      self.update += 1
      if self.total_anneal_steps > 0:
          anneal = min(
              self.anneal_cap,
              1.0 * self.update / self.total_anneal_steps,
          )
      else:
          anneal = self.anneal_cap
  
      z, mu, logvar = self.forward(rating_matrix)
  
      # KL loss
      kl_loss = (
          -0.5
          * (torch.sum(1 + logvar - mu.pow(2) - logvar.exp(), dim=1))
          * anneal
      )
  
      # CE loss
      ce_loss = -(F.log_softmax(z, 1) * rating_matrix).sum(1)
  
      return ce_loss + kl_loss
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  import numpy
  from recbole.model.abstract_recommender import AutoEncoderMixin, GeneralRecommender
  from recbole.model.init import xavier_normal_initialization
  from recbole.utils import InputType
label_desc: Use image node_id 5 for calling the RaCT obj's underlying member method code with example usage: obj.calculate_actor_loss(interaction) and returns: unknown