class_docstr: Implementation of self-supervised embedding models.
  
  Implements an embedding strategy based on self-supervised learning. A
  model backbone, self-supervised criterion, optimizer, and dataloader are
  passed to the constructor. The embedding itself is a pytorch-lightning
  module.
  
  The implementation is based on contrastive learning.
  
  * SimCLR: https://arxiv.org/abs/2002.05709
  * MoCo: https://arxiv.org/abs/1911.05722
  * SimSiam: https://arxiv.org/abs/2011.10566
  
  Attributes:
      model:
          A backbone convolutional network with a projection head.
      criterion:
          A contrastive loss function.
      optimizer:
          A PyTorch optimizer.
      dataloader:
          A torchvision dataloader.
      scheduler:
          A PyTorch learning rate scheduler.
  
  Examples:
      >>> # define a model, criterion, optimizer, and dataloader above
      >>> import lightly.embedding as embedding
      >>> encoder = SelfSupervisedEmbedding(
      >>>     model,
      >>>     criterion,
      >>>     optimizer,
      >>>     dataloader,
      >>> )
      >>> # train the self-supervised embedding with default settings
      >>> encoder.train_embedding()
      >>> # pass pytorch-lightning trainer arguments as kwargs
      >>> encoder.train_embedding(max_epochs=10)
class_docstr_tok: ["Implementation","of","self-supervised","embedding","models",".","Implements","an","embedding","strategy","based","on","self-supervised","learning",".","A","model","backbone",",","self-supervised","criterion",",","optimizer",",","and","dataloader","are","passed","to","the","constructor",".","The","embedding","itself","is","a","pytorch-lightning","module",".","The","implementation","is","based","on","contrastive","learning",".","*","SimCLR",":","https",":","\/\/arxiv.org\/abs\/2002.05709","*","MoCo",":","https",":","\/\/arxiv.org\/abs\/1911.05722","*","SimSiam",":","https",":","\/\/arxiv.org\/abs\/2011.10566","Attributes",":","model",":","A","backbone","convolutional","network","with","a","projection","head",".","criterion",":","A","contrastive","loss","function",".","optimizer",":","A","PyTorch","optimizer",".","dataloader",":","A","torchvision","dataloader",".","scheduler",":","A","PyTorch","learning","rate","scheduler",".","Examples",":",">",">",">","#","define","a","model",",","criterion",",","optimizer",",","and","dataloader","above",">",">",">","import","lightly.embedding","as","embedding",">",">",">","encoder","=","SelfSupervisedEmbedding","(",">",">",">","model",",",">",">",">","criterion",",",">",">",">","optimizer",",",">",">",">","dataloader",",",">",">",">",")",">",">",">","#","train","the","self-supervised","embedding","with","default","settings",">",">",">","encoder.train_embedding","(",")",">",">",">","#","pass","pytorch-lightning","trainer","arguments","as","kwargs",">",">",">","encoder.train_embedding","(","max_epochs=10",")"]
code: def __init__(
      self,
      model: BenchmarkModule,
      criterion: Module,
      optimizer: Optimizer,
      dataloader: DataLoader[LightlyDataset],
      scheduler: Optional[_LRScheduler] = None,
  ) -> None:
      super(SelfSupervisedEmbedding, self).__init__(
          model, criterion, optimizer, dataloader, scheduler
      )
  
file_path: lightly/lightly/embedding/embedding.py
imports: import time
  from typing import List, Optional, Tuple
  import numpy
  import torch
  from numpy.typing import NDArray
  from torch.nn import Module
  from torch.optim import Optimizer
  from torch.optim.lr_scheduler import _LRScheduler
  from torch.utils.data import DataLoader
  from tqdm import tqdm
  from lightly.data import LightlyDataset
  from lightly.embedding._base import BaseEmbedding
  from lightly.utils.benchmarking import BenchmarkModule
  from lightly.utils.reordering import sort_items_by_keys
label_desc: Use image node_id 1 to create a new SelfSupervisedEmbedding object from inherited base classes: BaseEmbedding with example: obj = SelfSupervisedEmbedding(model, criterion, optimizer, dataloader, scheduler)