Deep-reinforcement-learning-with-pytorch icon indicating copy to clipboard operation
Deep-reinforcement-learning-with-pytorch copied to clipboard

bug in reinforce with baseline

Open hlhang9527 opened this issue 4 years ago • 3 comments

the update value network should be:

    alpha_w = 1e-3  # 初始化

    optimizer_w = optim.Adam(**s_value_func**.parameters(), lr=alpha_w)
    optimizer_w.zero_grad()
    policy_loss_w =-delta
    policy_loss_w.backward(retain_graph = True)
    clip_grad_norm_(policy_loss_w, 0.1)
    optimizer_w.step()

hlhang9527 avatar Mar 21 '22 23:03 hlhang9527

There's some error in this code. when run this code,it shows some error about compute graph. do you meet the same problem?

stvsd1314 avatar Apr 12 '22 12:04 stvsd1314

same problem here, you can debug it step by step to see the errors

hlhang9527 avatar Apr 12 '22 14:04 hlhang9527