File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
agents/actor_critic_agents Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ def __init__(self, config):
3636 lr = self .hyperparameters ["Actor" ]["learning_rate" ])
3737 self .automatic_entropy_tuning = self .hyperparameters ["automatically_tune_entropy_hyperparameter" ]
3838 if self .automatic_entropy_tuning :
39- self .target_entropy = - self .environment .unwrapped .action_space .n / 4.0 # heuristic value from the paper
39+ # we set the max possible entropy as the target entropy
40+ self .target_entropy = self .action_size * (1.0 / self .action_size ) * np .log ((1.0 / self .action_size ))
4041 self .log_alpha = torch .zeros (1 , requires_grad = True , device = self .device )
4142 self .alpha = self .log_alpha .exp ()
4243 self .alpha_optim = Adam ([self .log_alpha ], lr = self .hyperparameters ["Actor" ]["learning_rate" ])
You can’t perform that action at this time.
0 commit comments