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

update target_model before loading saved model in cartpole_dqn.py #86

Open
nyck33 opened this issue Jan 23, 2019 · 0 comments
Open

update target_model before loading saved model in cartpole_dqn.py #86

nyck33 opened this issue Jan 23, 2019 · 0 comments

Comments

@nyck33
Copy link

nyck33 commented Jan 23, 2019

# initialize target model with same weights as the model, in case we load a model
       #shouldn't this be done after load_model?
       self.update_target_model()

       if self.load_model:
           self.model.load_weights("./save_model/cartpole_dqn.h5")

could be

if self.load_model:
            self.model.load_weights("./save_model/cartpole_dqn.h5")

 self.update_target_model()

so that if we load a saved model, the target_model would have the saved weights rather than starting with the Keras-initialized weights.

I'm going to test this but it seems like the loaded model would be using an inferior target_model for at least the first episode and the model weights could get adjusted in the wrong way in that first episode, slightly slowing down it's learning.

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

1 participant