Skip to content

Commit

Permalink
Fix bounded exploration
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaoting159753 committed Jan 1, 2025
1 parent e3cf728 commit 971884c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def select_action_from_policy(
multi_log_pi = multi_log_pi.squeeze()
policy_dist = F.softmax(multi_log_pi, dim=0)

final_dist = policy_dist + self.threshold * world_dist
final_dist = (1- self.threshold) * policy_dist + self.threshold * world_dist
final_dist = F.softmax(final_dist, dim=0)
# candi = torch.argmax(final_dist)
new_dist = torch.distributions.Categorical(final_dist)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def select_action_from_policy(

multi_log_pi = multi_log_pi.squeeze()
policy_dist = F.softmax(multi_log_pi, dim=0)
final_dist = policy_dist + self.threshold * world_dist
final_dist = (1 - self.threshold) * policy_dist + self.threshold * world_dist

# candi = torch.argmax(final_dist)
final_dist = F.softmax(final_dist, dim=0)
Expand Down

0 comments on commit 971884c

Please sign in to comment.