byol-pytorch is a Python library that implements Bootstrap Your Own Latent (BYOL), a self-supervised learning method for image representations. The core contribution is the `BYOL` module, which wraps any PyTorch image backbone (e.g., ResNet) and trains it without labels by maximizing agreement between two augmented views of the same image. The library derives its behavior from code rather than promises: it computes a cosine loss between online predictions and target projections, where the target encoder is an exponential moving average of the online encoder (or the online encoder itself for the SimSiam variant). It also supports optional Simplicial Embeddings (SEM) and custom augmentation pipelines.
This repository implements a two-stage generative image model: Representation Autoencoders (RAE) followed by Diffusion Transformers (DiT^DH). Stage 1 trains a ViT decoder to reconstruct images from frozen pretrained encoders (DINOv2, MAE, SigLIP), with optional GAN and LPIPS losses. Stage 2 trains a class-conditional diffusion transformer on the resulting latent space, supporting both classifier-free guidance and autoguidance. The codebase is config-driven (OmegaConf), PyTorch DDP, and provides training, distributed sampling, FID evaluation, and latent statistics computation. It is a research codebase with strong engineering quality, modular design (transport, discriminator, encoders, decoders), and reproducibility through pinned dependencies and checkpointing.