-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Self-supervised learning - BYOL implementation #1305
Conversation
source_model_key: key to the source data inside `runner.model` | ||
tau: smoothing parameter `target * (1.0 - tau) + source * tau` | ||
""" | ||
super().__init__(order=CallbackOrder.Metric) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
External, maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my understanding, it should be on the same level as Criterion (change of the model), but maybe you have another point.
# flake8: noqa | ||
import argparse | ||
|
||
from common import add_arguments, ContrastiveModel, datasets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we use local naming?
like from .common
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
Co-authored-by: Sergey Kolesnikov <scitator@gmail.com>
… into byol-implemention
… into byol-implemention
catalyst/runners/self_supervised.py
Outdated
if isinstance(self.model, (collections.Mapping, nn.ModuleDict)): | ||
encoders = [(encoder_name, self.model[encoder_name]) for encoder_name in self.model] | ||
else: | ||
encoders = [("", self.model)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's move it to on_stage_start
so we could set up some internal flag like is_kv_model
once per stage rather than every batch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like that?
# flake8: noqa | ||
import argparse | ||
|
||
from common import add_arguments, ContrastiveModel, datasets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
catalyst/runners/self_supervised.py
Outdated
@@ -13,6 +16,7 @@ class ISelfSupervisedRunner(IRunner): | |||
augemention_prefix: key for ``runner.batch`` to sample augumentions | |||
projection_prefix: key for ``runner.batch`` to store model projection | |||
embedding_prefix: key for `runner.batch`` to store model embeddings | |||
encoders: encoder keys inside `model` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before submitting (checklist)
catalyst-make-codestyle -l 99 && catalyst-check-codestyle -l 99
(pip install -U catalyst-codestyle
).make check-docs
?pytest .
?latest
andminimal
requirements?Description
Bootstrap Your Own Latent (BYOL) is an approach to self-supervised image representation learning. BYOL relies on two neural networks, referred to as online and target networks, that interact and learn from each other. From an augmented view of an image, we train the online network to predict the target network representation of the same image under a different augmented view.
For this pipeline, we need to implement a callback for updating the target network from the online network (SoftUpdateCallback) and add a multi-encoder strategy in SelfSupervisedRunner.
Related Issue
Type of Change
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
FAQ
Please review the FAQ before submitting an issue: