MishaLaskin / curl

CURL: Contrastive Unsupervised Representation Learning for Sample-Efficient Reinforcement Learning
MIT License
570 stars 87 forks source link

encoder updated twice for curl loss #28

Open xy9485 opened 1 year ago

xy9485 commented 1 year ago

I'm looking into the code and find that in def update_cpc() both self.encoder_optimizer.step() and self.cpc_optimizer.step() are called. However the parameters of critic.encoder are carried by both optimizer. Isn't it true that, in def update_cpc(), critic.encoder is updated twice using the same gradient?

Penelope-zhang commented 1 year ago

@xy9485 do you know why critic.encoder is updated twice in def update_cpc()?

LYK-love commented 3 months ago

Yeah that's true. I don't know the reason of doing this.