class_docstr: Performs Non-Parametric Instance Discrimination for self supervised learning on
  video. A memory bank is built to keep and update the historical feature embedding
  and use them for contrastive learning.
  
  The original paper is:
  Unsupervised Feature Learning via Non-Parametric Instance Discrimination
  https://arxiv.org/pdf/1805.01978.pdf
  
  More details can be found from the memory bank part in the following paper:
  Momentum Contrast for Unsupervised Visual Representation Learning
  https://arxiv.org/pdf/1911.05722.pdf
class_docstr_tok: ["Performs","Non-Parametric","Instance","Discrimination","for","self","supervised","learning","on","video",".","A","memory","bank","is","built","to","keep","and","update","the","historical","feature","embedding","and","use","them","for","contrastive","learning",".","The","original","paper","is",":","Unsupervised","Feature","Learning","via","Non-Parametric","Instance","Discrimination","https",":","\/\/arxiv.org\/pdf\/1805.01978.pdf","More","details","can","be","found","from","the","memory","bank","part","in","the","following","paper",":","Momentum","Contrast","for","Unsupervised","Visual","Representation","Learning","https",":","\/\/arxiv.org\/pdf\/1911.05722.pdf"]
docstr: Args:
      backbone (nn.Module): backbone used to forward the input.
      mlp (nn.Module): multi-layer perception used in memory bank instance
          discrimination model.
      neg_size (int): size of negative samples per instance.
      temperature (float): temperature to use for contrastive learning.
      bank_size (int): size of the memory bank, expected to be the same size as
          the training set.
      dim (int): dimension of the channel.
      mmt (float): momentum to use.
docstr_tok: ["Args",":","backbone","(","nn.Module",")",":","backbone","used","to","forward","the","input",".","mlp","(","nn.Module",")",":","multi-layer","perception","used","in","memory","bank","instance","discrimination","model",".","neg_size","(","int",")",":","size","of","negative","samples","per","instance",".","temperature","(","float",")",":","temperature","to","use","for","contrastive","learning",".","bank_size","(","int",")",":","size","of","the","memory","bank",",","expected","to","be","the","same","size","as","the","training","set",".","dim","(","int",")",":","dimension","of","the","channel",".","mmt","(","float",")",":","momentum","to","use","."]
code: def __init__(
      self,
      backbone: nn.Module,
      mlp: Optional[nn.Module] = None,
      neg_size: int = 4096,
      temperature: float = 0.07,
      bank_size: int = 1280000,
      dim: int = 2048,
      mmt: float = 0.999,
  ) -> None:
      """
      Args:
          backbone (nn.Module): backbone used to forward the input.
          mlp (nn.Module): multi-layer perception used in memory bank instance
              discrimination model.
          neg_size (int): size of negative samples per instance.
          temperature (float): temperature to use for contrastive learning.
          bank_size (int): size of the memory bank, expected to be the same size as
              the training set.
          dim (int): dimension of the channel.
          mmt (float): momentum to use.
      """
      super().__init__()
      set_attributes(self, locals())
      self._init_mem_bank(bank_size, dim)
  
file_path: pytorchvideo/pytorchvideo/models/memory_bank.py
imports: import math
  from typing import Optional
  import torch
  import torch.nn
  import torch.nn.functional
  from pytorchvideo.layers.utils import set_attributes
label_desc: Use image node_id 1 to create a new MemoryBank object from inherited base classes: nn with example: obj = MemoryBank(backbone, mlp, neg_size, temperature, bank_size, dim, mmt)