Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions METHODS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Methods come in two forms:
| SimCLR | `simclr` | `SimCLR` | `NTXEntLoss` | — | [Chen et al., 2020](https://arxiv.org/abs/2002.05709) |
| BYOL | `byol` | `BYOL` | `BYOLLoss` | `TeacherStudent†` | [Grill et al., 2020](https://arxiv.org/abs/2006.07733) |
| VICReg | `vicreg` | `VICReg` | `VICRegLoss` | — | [Bardes et al., 2022](https://arxiv.org/abs/2105.04906) |
| CorInfoMax | `corinfomax` | `CorInfoMax` | `CorInfoMaxLoss` | — | [Ozsoy et al., 2022](https://arxiv.org/abs/2209.07999) |
| Barlow Twins | `barlow_twins` | `BarlowTwins` | `BarlowTwinsLoss` | — | [Zbontar et al., 2021](https://arxiv.org/abs/2103.03230) |
| SwAV | `swav` | `SwAV` | `SwAVLoss` | `OnlineQueue` | [Caron et al., 2020](https://arxiv.org/abs/2006.09882) |
| NNCLR | `nnclr` | `NNCLR` | `NTXEntLoss` | `OnlineQueue` | [Dwibedi et al., 2021](https://arxiv.org/abs/2104.14548) |
Expand Down Expand Up @@ -106,6 +107,7 @@ All loss classes are importable from `stable_pretraining.losses`:
| `NTXEntLoss` | SimCLR, NNCLR, MoCov2, MoCov3 |
| `BYOLLoss` | BYOL |
| `VICRegLoss` | VICReg, VICRegL |
| `CorInfoMaxLoss` | CorInfoMax |
| `BarlowTwinsLoss` | Barlow Twins |
| `SwAVLoss` | SwAV |
| `DINOv1Loss` | DINO, iBOT, MIMRefiner |
Expand Down
8 changes: 8 additions & 0 deletions RELEASES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ Unreleased

**New method**

- ``CorInfoMax``: combines agreement between augmented views with running
covariance log-determinants to discourage dimensional collapse, per Ozsoy
et al., "Self-Supervised Learning with an Information Maximization Criterion"
(NeurIPS 2022). Includes the ``spt.CorInfoMax`` method, composable
``corinfomax`` forward function, and ``CorInfoMaxLoss`` with checkpointed
running statistics. Adds a CIFAR-10 pretraining and frozen linear evaluation
recipe in ``benchmarks/cifar10/corinfomax-resnet18.py``, focused unit tests, and API
documentation.
- ``PMSN`` (Prior Matching for Siamese Networks): extends ``MSN`` by replacing
its uniform-prior mean-entropy regulariser with a KL-divergence term against
an arbitrary prior distribution over prototypes (power-law by default,
Expand Down
39 changes: 39 additions & 0 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,45 @@ python benchmarks/cifar10/barlow-resnet18.py
python benchmarks/cifar10/nnclr-resnet18.py
```

### CorInfoMax CIFAR-10 benchmark

[`cifar10/corinfomax-resnet18.py`](cifar10/corinfomax-resnet18.py) runs
pretraining, frozen linear fitting, and evaluation as separate phases through
`spt.Manager`. It uses a CIFAR-resolution ResNet-18 and a 2048–2048–64 projector.
The single-device recipe uses batch size **512** for **1,000 pretraining
epochs** and batch size **256** for **100 frozen linear-fitting epochs**.
Both batch sizes count original images; pretraining makes two views per image.
The pretraining batch size is also the global batch size, with no accumulation.

Run from the repository root, replacing the checkpoint placeholders with paths
printed by the preceding phase:

```bash
python benchmarks/cifar10/corinfomax-resnet18.py pretrain \
--data-dir ./data/cifar10 --output-dir ./runs/corinfomax \
--epochs 1000 --batch-size 512 --download
python benchmarks/cifar10/corinfomax-resnet18.py linear \
--data-dir ./data/cifar10 --output-dir ./runs/corinfomax \
--epochs 100 --batch-size 256 --checkpoint /absolute/path/to/pretrain.ckpt
python benchmarks/cifar10/corinfomax-resnet18.py evaluate \
--data-dir ./data/cifar10 --output-dir ./runs/corinfomax \
--batch-size 256 --checkpoint /absolute/path/to/linear.ckpt
```

To resume either training phase, use `--resume /absolute/path/to/phase.ckpt`
with the original phase, seed, batch size, epochs, and warmup settings. Loading
full training state requires a trusted local checkpoint.

The recorded run reports **92.75% final test top-1** and **99.84% final test
top-5** after linear fitting. Its best observed test top-1 was **92.85%**
(epoch 83; **99.86%** top-5), confirmed by a separate evaluation of that
checkpoint. These are frozen linear evaluations on the 10,000-image CIFAR-10
test split. The best test score is descriptive; report the final epoch as the
primary result rather than selecting a checkpoint by test accuracy. The
recorded pretraining log has 97 batches per epoch, consistent with the recipe's
batch size 512 and `drop_last=True`; linear-fitting logs explicitly show 256.
These existing results have not been rerun after the numerical guard change.

## Notes

- The data directory will be created automatically if it doesn't exist
Expand Down
Loading
Loading