PyTorch code for VICReg self-supervised learning research paper
Top 59.4% on sourcepulse
This repository provides the official PyTorch implementation for VICReg, a self-supervised learning method that uses variance, invariance, and covariance regularization to train powerful visual representations. It is targeted at researchers and engineers working on computer vision and deep learning who need robust feature extractors without labeled data.
How It Works
VICReg addresses the collapse problem in self-supervised learning by introducing three regularization terms: variance, invariance, and covariance. Variance regularization ensures that the features have high variance, preventing trivial solutions. Invariance regularization encourages similar representations for augmented views of the same image. Covariance regularization decorrelates features within the embedding, promoting richer representations. This approach is advantageous as it avoids the need for large batch sizes or memory banks, common in other self-supervised methods.
Quick Start & Requirements
pip install torch torchvision submitit
(for multi-node training)import torch
resnet50 = torch.hub.load('facebookresearch/vicreg:main', 'resnet50')
python -m torch.distributed.launch --nproc_per_node=8 main_vicreg.py --data-dir /path/to/imagenet/ --exp-dir /path/to/experiment/ --arch resnet50 --epochs 100 --batch-size 512 --base-lr 0.3
Highlighted Details
Maintenance & Community
This project is from Meta AI. No specific community links (Discord/Slack) or roadmap are provided in the README.
Licensing & Compatibility
Limitations & Caveats
The code was developed for specific PyTorch and torchvision versions (1.8.1 and 0.9.1 respectively), though compatibility with newer versions is suggested. Training requires a substantial dataset like ImageNet and significant computational resources (multiple GPUs).
2 years ago
1 week