-
Notifications
You must be signed in to change notification settings - Fork 280
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
coma td_error 中target q的计算问题 #25
Comments
(1)COMA是on-policy,所以只能用当前策略去选择下一个动作,而不能像DQN那样选择最大的。 |
(1) make sense
|
关于(1), 有更多的指教吗,就是说, 如果像dqn那样选最大的,会又啥问题?? 另外,policy gradient这类算法一般是on-policy的。value-based一般是off policy训练。但是td error本身一般都是用在off policy方法上。 多谢!🙏 |
最后一步真实,u_next是填充,但是由于terminated的存在,计算q_target时会抹掉u_next对应的Q值,只剩下r。 COMA的Critic也需要是on-policy来更新,更新actor的advantage需要服从策略对应的分布,而advantage是critic计算出来的。 |
豁然开朗,非常感谢。 |
Hi, 老兄,又来请教一番,哈哈。
我注意到在coma中q_next_target的计算,有点不太理解,为啥这么计算。
282 q_evals = torch.gather(q_evals, dim=3, index=u).squeeze(3)
283 q_next_target = torch.gather(q_next_target, dim=3, index=u_next).squeeze(3)
根据我的理解,一般有两种计算target的方式,dqn, 或者ddqn. 前者用eval net的argmax取action, 后者直接target net取argmax.
这里我有2个问题:
(1) 为啥用执行的u_next来选取动作呢, 不用dqn或者ddqn的方式?
(2) 这个u_next的最后一步(因为实际最后teminate的时候没动作)是用0填充的,我看了看smac的源码, 0大概是noop,但是noop对活的agent是不可用的。所以这样会不会有问题?
The text was updated successfully, but these errors were encountered: