Skip to content
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

Copy vs Deepcopy in SAC #74

Open
richardrl opened this issue Aug 9, 2019 · 4 comments
Open

Copy vs Deepcopy in SAC #74

richardrl opened this issue Aug 9, 2019 · 4 comments

Comments

@richardrl
Copy link
Contributor

I'm using a previous version of SAC (with separate Q and V value function) but noticed something strange.

there is this line in twin_sac.py:
self.target_vf = vf.copy()

Changing it to a deepcopy results in very different training curves (see curves attached):

        from copy import deepcopy
        self.target_vf = deepcopy(vf)

vf.copy() is defined as such:

  def copy(self):
       copy = Serializable.clone(self)
       ptu.copy_model_params_from_to(self, copy)
       return copy

It looks like it should do essentially the same thing as deepcopy, so what's causing the difference..

deepcopy

@vitchyr
Copy link
Collaborator

vitchyr commented Aug 10, 2019

Yeah, that's really odd. Can you check if deepcopy copies the weight values as well?

@vitchyr
Copy link
Collaborator

vitchyr commented Sep 6, 2019

@richardrl Did you ever get around to seeing what's going on? Also, which curve is which?

@richardrl
Copy link
Contributor Author

I have not figured out why this is happening yet. The .copy() is the orange curve that actually trains. This is just on picknplace with the fetch robotics task.

@vitchyr
Copy link
Collaborator

vitchyr commented Oct 26, 2019

Did you check if deepcopy copies the weights over (as reference or as value)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants