byol-pytorch icon indicating copy to clipboard operation
byol-pytorch copied to clipboard

About target encoder

Open ZhaoYuTJPU opened this issue 2 years ago • 3 comments

First of all, thanks for your work. I have a question about the parameter update of the Target encoder. As shown in the figure, the function will be executed in each forward process, and then the parameters will be copied from the Online encoder instead of always using the EMA update. I don't understand it very well. I look forward to your reply. image image

ZhaoYuTJPU avatar Apr 05 '23 03:04 ZhaoYuTJPU

I have the same confusion about the projector in online_encoder. The projector is created every time in the forward() of online_encoder. Have you figured it out?

lc17721825 avatar Sep 24 '23 09:09 lc17721825

Hello. I think I've solved the problem. The function _get_target_encoder has a decorator on it, which makes it run only once, not every time. You can see this process with single-step debugging. I hope this solves your problem.

ZhaoYuTJPU avatar Sep 24 '23 09:09 ZhaoYuTJPU

Thanks for your reply. The projector follows the same situation and uses a decorator.

lc17721825 avatar Sep 24 '23 09:09 lc17721825