dgriff777 / rl_a3c_pytorch

A3C LSTM Atari with Pytorch plus A3G design
Apache License 2.0
562 stars 119 forks source link

Is there any necessary to lock when update params? #36

Open Ranglage opened 4 years ago

Ranglage commented 4 years ago

It seems doesn't get lock when update network params in SharedAdam. However, isn't there process safety problem without a lock?

dgriff777 commented 4 years ago

Yes, there is possibility for bad updates if race condition occurs but such bad updates are quickly overwritten by new incoming updates. Although this can look to be as a disadvantage to this method, the use of locks are substantially time consuming. Overall, any negative is far outweighed by the increase in speed of updates.