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","."]
code: def __init__(
      self,
      num_items,
      embedding_dim=32,
      item_embedding_layer=None,
      sparse=False,
  ):
      super(PoolNet, self).__init__()
  
      self.embedding_dim = embedding_dim
  
      if item_embedding_layer is not None:
          self.item_embeddings = item_embedding_layer
      else:
          self.item_embeddings = ScaledEmbedding(
              num_items,
              embedding_dim,
              padding_idx=PADDING_IDX,
              sparse=sparse,
          )
  
      self.item_biases = ZeroEmbedding(
          num_items, 1, sparse=sparse, padding_idx=PADDING_IDX
      )
  
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 1 to create a new PoolNet object from inherited base classes: nn with example: obj = PoolNet(num_items, embedding_dim, item_embedding_layer, sparse)