Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 945 Bytes

self_supervised_utils.rst

File metadata and controls

41 lines (27 loc) · 945 Bytes

Self-supervised learning

Collection of useful functions for self-supervised learning


Identity class

Example:

from pl_bolts.utils import Identity

pl_bolts.utils.self_supervised.Identity


SSL-ready resnets

Torchvision resnets with the fc layers removed and with the ability to return all feature maps instead of just the last one.

Example:

from pl_bolts.utils.self_supervised import torchvision_ssl_encoder

resnet = torchvision_ssl_encoder('resnet18', pretrained=False, return_all_feature_maps=True)
x = torch.rand(3, 3, 32, 32)

feat_maps = resnet(x)

pl_bolts.utils.self_supervised.torchvision_ssl_encoder


SSL backbone finetuner

pl_bolts.models.self_supervised.ssl_finetuner.SSLFineTuner