Skip to content
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

(To be discussed) (Idea) feature: multi dimensional reward #225

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
2 changes: 1 addition & 1 deletion handyrl/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def compose_losses(outputs, log_selected_policies, total_advantages, targets, ba
entropy = dist.Categorical(logits=outputs['policy']).entropy().mul(tmasks.sum(-1))
losses['ent'] = entropy.sum()

base_loss = losses['p'] + losses.get('r', 0)
base_loss = losses['p'] + losses.get('v', 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, thank you

entropy_loss = entropy.mul(1 - batch['progress'] * (1 - args['entropy_regularization_decay'])).sum() * -args['entropy_regularization']
losses['total'] = base_loss + entropy_loss

Expand Down