AI4Finance-Foundation / AI4Finance-Foundation/ElegantRL

A policy update bug in AgentPPO?

オープン
#243 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
dicussion
主要言語
Python
スター
4.4k
フォーク
978
PR マージ指標
30日以内にマージされた PR はありません

説明

The following codes show that the policy used to explore the env (generate the action and logprob) is 'self.act',
```
get_action = self.act.get_action
convert = self.act.convert_action_for_env
for i in range(horizon_len):
state = torch.as_tensor(ary_state, dtype=torch.float32, device=self.device)
action, logprob = [t.squeeze() for t in get_action(state.unsqueeze(0))]
```
while in the update function, the actions and policy used to calculate the 'new_log_prob' are exactly the same as the ones above:
```
new_logprob, obj_entropy = self.act.get_logprob_entropy(state, action)
ratio = (new_logprob - logprob.detach()).exp()
```
I think that 'ratio' will be always 1.
Is it a bug or there is something I misunderstand?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。