AI4Finance-Foundation / AI4Finance-Foundation/ElegantRL

A policy update bug in AgentPPO?

Đang mở
#243 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
dicussion
Ngôn ngữ chính
Python
Star
4.4k
Fork
978
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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?

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.