class_docstr: Module representing users through averaging the representations of items
  they have interacted with, a'la [1]_.
  
  To represent a sequence, it simply averages the representations of all
  the items that occur in the sequence up to that point.
  
  During training, representations for all timesteps of the sequence are
  computed in one go. Loss functions using the outputs will therefore
  be aggregating both across the minibatch and across time in the sequence.
  
  Parameters
  ----------
  
  num_items: int
      Number of items to be represented.
  embedding_dim: int, optional
      Embedding dimension of the embedding layer.
  item_embedding_layer: an embedding layer, optional
      If supplied, will be used as the item embedding layer
      of the network.
  
  References
  ----------
  
  .. [1] Covington, Paul, Jay Adams, and Emre Sargin. "Deep neural networks for
     youtube recommendations." Proceedings of the 10th ACM Conference
     on Recommender Systems. ACM, 2016.
class_docstr_tok: ["Module","representing","users","through","averaging","the","representations","of","items","they","have","interacted","with",",","a'la","[","1","]","_",".","To","represent","a","sequence",",","it","simply","averages","the","representations","of","all","the","items","that","occur","in","the","sequence","up","to","that","point",".","During","training",",","representations","for","all","timesteps","of","the","sequence","are","computed","in","one","go",".","Loss","functions","using","the","outputs","will","therefore","be","aggregating","both","across","the","minibatch","and","across","time","in","the","sequence",".","Parameters","--","--","--","--","--","num_items",":","int","Number","of","items","to","be","represented",".","embedding_dim",":","int",",","optional","Embedding","dimension","of","the","embedding","layer",".","item_embedding_layer",":","an","embedding","layer",",","optional","If","supplied",",","will","be","used","as","the","item","embedding","layer","of","the","network",".","References","--","--","--","--","--","..","[","1","]","Covington",",","Paul",",","Jay","Adams",",","and","Emre","Sargin",".","``","Deep","neural","networks","for","youtube","recommendations",".","''","Proceedings","of","the","10th","ACM","Conference","on","Recommender","Systems",".","ACM",",","2016","."]
docstr: Compute predictions for target items given user representations.
  
  Parameters
  ----------
  
  user_representations: tensor
      Result of the user_representation_method.
  targets: tensor
      Minibatch of item sequences of shape
      (minibatch_size, sequence_length).
  
  Returns
  -------
  
  predictions: tensor
      of shape (minibatch_size, sequence_length)
docstr_tok: ["Compute","predictions","for","target","items","given","user","representations",".","Parameters","--","--","--","--","--","user_representations",":","tensor","Result","of","the","user_representation_method",".","targets",":","tensor","Minibatch","of","item","sequences","of","shape","(","minibatch_size",",","sequence_length",")",".","Returns","--","--","--","-","predictions",":","tensor","of","shape","(","minibatch_size",",","sequence_length",")"]
code: def forward(self, user_representations, targets):
      """
      Compute predictions for target items given user representations.
  
      Parameters
      ----------
  
      user_representations: tensor
          Result of the user_representation_method.
      targets: tensor
          Minibatch of item sequences of shape
          (minibatch_size, sequence_length).
  
      Returns
      -------
  
      predictions: tensor
          of shape (minibatch_size, sequence_length)
      """
  
      target_embedding = (
          self.item_embeddings(targets).permute(0, 2, 1).squeeze()
      )
      target_bias = self.item_biases(targets).squeeze()
  
      dot = (user_representations * target_embedding).sum(1)
  
      return target_bias + dot
  
imports: import torch
  from torch.backends import cudnn
  import torch.nn
  import torch.nn.functional
  from spotlight.layers import ScaledEmbedding, ZeroEmbedding
label_desc: Use image node_id 3 for calling the PoolNet obj's underlying member method code with example usage: obj.forward(user_representations, targets) and returns: unknown