class_docstr: RippleNet is an knowledge enhanced matrix factorization model.
  The original interaction matrix of :math:`n_{users} \times n_{items}`
  and related knowledge graph is set as model input,
  we carefully design the data interface and use ripple set to train and test efficiently.
  We just implement the model following the original author with a pointwise training mode.
class_docstr_tok: ["RippleNet","is","an","knowledge","enhanced","matrix","factorization","model",".","The","original","interaction","matrix","of",":","math",":","`","n_","{","users","}","\\times","n_","{","items","}","`","and","related","knowledge","graph","is","set","as","model","input",",","we","carefully","design","the","data","interface","and","use","ripple","set","to","train","and","test","efficiently",".","We","just","implement","the","model","following","the","original","author","with","a","pointwise","training","mode","."]
docstr: Conduct reasoning for specific item and user ripple set
  
  Returns:
      o_list (dict -> torch.cuda.FloatTensor): list of torch.cuda.FloatTensor
          n_hop * [batch_size, n_item, embedding_size]
docstr_tok: ["Conduct","reasoning","for","specific","item","and","user","ripple","set","Returns",":","o_list","(","dict","-",">","torch.cuda.FloatTensor",")",":","list","of","torch.cuda.FloatTensor","n_hop","*","[","batch_size",",","n_item",",","embedding_size","]"]
code: def _key_addressing_full(self):
      r"""Conduct reasoning for specific item and user ripple set
  
      Returns:
          o_list (dict -> torch.cuda.FloatTensor): list of torch.cuda.FloatTensor
              n_hop * [batch_size, n_item, embedding_size]
      """
      o_list = []
      for hop in range(self.n_hop):
          # [batch_size * n_memory, dim, 1]
          h_emb = self.h_emb_list[hop].unsqueeze(2)
  
          # [batch_size * n_memory, dim, dim]
          r_mat = self.r_emb_list[hop].view(
              -1, self.embedding_size, self.embedding_size
          )
          # [batch_size, n_memory, dim]
          Rh = torch.bmm(r_mat, h_emb).view(
              -1, self.n_memory, self.embedding_size
          )
  
          batch_size = Rh.size(0)
  
          if len(self.item_embeddings.size()) == 2:
              # [1, n_item, dim]
              self.item_embeddings = self.item_embeddings.unsqueeze(0)
              # [batch_size, n_item, dim]
              self.item_embeddings = self.item_embeddings.expand(
                  batch_size, -1, -1
              )
              # [batch_size, dim, n_item]
              v = self.item_embeddings.transpose(1, 2)
              # [batch_size, dim, n_item]
              v = v.expand(batch_size, -1, -1)
          else:
              assert len(self.item_embeddings.size()) == 3
              # [batch_size, dim, n_item]
              v = self.item_embeddings.transpose(1, 2)
  
          # [batch_size, n_memory, n_item]
          probs = torch.bmm(Rh, v)
  
          # [batch_size, n_memory, n_item]
          probs_normalized = self.softmax(probs)
  
          # [batch_size, n_item, n_memory]
          probs_transposed = probs_normalized.transpose(1, 2)
  
          # [batch_size, n_memory, dim]
          tail_emb = self.t_emb_list[hop].view(
              -1, self.n_memory, self.embedding_size
          )
  
          # [batch_size, n_item, dim]
          o = torch.bmm(probs_transposed, tail_emb)
  
          # [batch_size, n_item, dim] [batch_size, n_item, dim] -> [batch_size, n_item, dim]
          self.item_embeddings = self.transform_matrix(
              self.item_embeddings + o
          )
          # item embedding update
          o_list.append(o)
      return o_list
  
file_path: RecBole/recbole/model/knowledge_aware_recommender/ripplenet.py
imports: import collections
  import numpy
  import torch
  import torch.nn
  from recbole.model.abstract_recommender import KnowledgeRecommender
  from recbole.model.init import xavier_normal_initialization
  from recbole.model.loss import BPRLoss, EmbLoss
  from recbole.utils import InputType
label_desc: Use image node_id 7 for calling the RippleNet obj's underlying member method code with example usage: obj._key_addressing_full() and returns: o_list