class_docstr: KSR integrates the RNN-based networks with Key-Value Memory Network (KV-MN).
  And it further incorporates knowledge base (KB) information to enhance the semantic representation of KV-MN.
class_docstr_tok: ["KSR","integrates","the","RNN-based","networks","with","Key-Value","Memory","Network","(","KV-MN",")",".","And","it","further","incorporates","knowledge","base","(","KB",")","information","to","enhance","the","semantic","representation","of","KV-MN","."]
code: def _memory_update_cell(self, user_memory, update_memory):
      z = torch.sigmoid(
          torch.mul(user_memory, update_memory).sum(-1).float()
      ).unsqueeze(
          -1
      )  # [B R 1], the gate vector
      updated_user_memory = (1.0 - z) * user_memory + z * update_memory
      return updated_user_memory
  
file_path: RecBole/recbole/model/sequential_recommender/ksr.py
imports: import torch
  from torch import nn
  from torch.nn.init import xavier_uniform_, xavier_normal_
  from recbole.model.abstract_recommender import SequentialRecommender
  from recbole.model.loss import BPRLoss
label_desc: Use image node_id 4 for calling the KSR obj's underlying member method code with example usage: obj._memory_update_cell(user_memory, update_memory) and returns: updated_user_memory