Repository navigation
Add ReSSL - #455
Open
chrisbutulis wants to merge 12 commits into
Open
Add ReSSL#455chrisbutulis wants to merge 12 commits into
chrisbutulis wants to merge 12 commits into
Conversation
…d.py, and loss function in losses/resslloss.py, as well as expirement for CIFAR-10
…paper, changed gaussian augmentation to match paper specs
chrisbutulis
marked this pull request as draft
October 16, 2026 22:07
chrisbutulis
marked this pull request as ready for review
October 16, 2026 22:08
Leon-Leyang
requested changes
Nov 23, 2026
Leon-Leyang
left a comment
Collaborator
There was a problem hiding this comment.
Hi @chrisbutulis, I've gone through the PR. Please check the issues below:
stable_pretraining/methods/ressl.py:136:ReSSL.forwardtakes(weak_augmentation, contrastive_augmentation)and repeats the steps ofressl(stable_pretraining/forward.py:537). It should take(batch, stage)and return a dict with"loss", calling the forward function instead of repeating it.stable_pretraining/__init__.py:ReSSLisn't exported from the top-level package (_LAZY_ATTRS,__all__,stable_pretraining/__init__.pyi).stable_pretraining/utils/ressl.py:6:gather_teacher_keysreimplementsall_gather(stable_pretraining/utils/distributed.py:234), which MoCov3 already uses for the same purpose (stable_pretraining/methods/mocov3.py:55).stable_pretraining/tests/unit/test_ressl.py: no test trains ReSSL throughspt.Manager(a small model and a few training steps are enough) and resumes from a checkpoint, showing that the EMA teacher (with its BatchNorm statistics) and the queue survive the resume.stable_pretraining/tests/unit/test_ressl.py: no test checks thatReSSLLossand its gradients stay finite on extreme inputs.stable_pretraining/backbone/split_batchnorm.py:12: the new publicSplitBatchNormhas no tests.benchmarks/cifar10/ressl-resnet18-lineareval.py: the reported 90.11–90.28 range comes from several linear-evaluation runs, but the description doesn't say which settings (branch, schedule, learning rate) each used. Please make the script's defaults reproduce the reported result, or state the exact commands.METHODS.md:46: the forward-function column is—although the PR addsressl, and the key-callbacks column listsOnlineQueue, which ReSSL doesn't use.docs/source/api/:ReSSL, theresslforward function andReSSLLossaren't listed inmethods.rst,forward.rstandlosses.rst.RELEASES.rst:20: the ReSSL entry is indented under theVISRegentry, so it renders as part of it.
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #455 +/- ##
==========================================
- Coverage 98.17% 98.13% -0.04%
==========================================
Files 163 167 +4
Lines 16406 16496 +90
==========================================
+ Hits 16107 16189 +82
- Misses 299 307 +8 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds an implementation of ReSSL (Relational Self-Supervised Learning), introduced in Zheng et al., NeurIPS 2021.
ReSSL learns visual representations by matching the similarity distributions of a student and momentum-updated teacher over a memory queue of teacher embeddings. Unlike instance-discrimination approaches, ReSSL transfers relational information between samples using weakly augmented teacher views and strongly augmented student views.
The implementation supports both the standalone method API and the composable stable_pretraining.forward interface.
Benchmark
Evaluated ReSSL on CIFAR-10 using a ResNet-18 backbone to compare performance with the original paper. Achieved results between 90.11 and 90.28 top-1 accuracy using linear evaluation after 200 epochs of pretraining.
Tests
Added unit tests for the loss, EMA behavior, queue operations, gradient flow, and distributed training, including Lightning DDP integration. All ReSSL tests pass locally.
Planned Work
Checklist