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

When will RND_predictor_Model().lets_init_weights be called? #5

Open
wangyuhuix opened this issue Aug 11, 2020 · 3 comments
Open

When will RND_predictor_Model().lets_init_weights be called? #5

wangyuhuix opened this issue Aug 11, 2020 · 3 comments

Comments

@wangyuhuix
Copy link

I notice that you have write the initialization code for RND_predictor_Model. But I failed to find where and when it has been called.

class RND_predictor_Model(nn.Module):
    def init_state_predict_weights(self, m):
        for name, param in m.named_parameters():
            if 'bias' in name:
                nn.init.constant_(param, 0.01)
            elif 'weight' in name:
                nn.init.constant_(param, 1)
@wisnunugroho21
Copy link
Owner

it will be called inside lets_init_weights in RND_predictor_Model class

def lets_init_weights(self): 
      self.state_predict_layer.apply(self.init_state_predict_weights)

@wangyuhuix
Copy link
Author

Thanks for your reply.
But when will lets_init_weights() be called?
I have run the ppo_rnd_taxi_final_blow_pytorch.py, but it seems that lets_init_weights () is never called during the running process.

@wisnunugroho21
Copy link
Owner

i have comment the code to init weights. just uncomment the code on line 551

if load_weights:
        agent.load_weights()
        print('Weight Loaded')
'''else :
        agent.lets_init_weights()
        print('Init Weight')'''

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