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

What is the reason for returning mean in SAC get_action function if it's never used? #333

Open
3 tasks done
sudonymously opened this issue Dec 23, 2022 · 1 comment
Open
3 tasks done

Comments

@sudonymously
Copy link

Problem Description

In the script sac_continuous_action.py, the get_action function in the Actor class returns action, log_prob, mean. action and log_prob is used but mean is never used. Is there a reason to return that value when it's never used in the code? As a new comer it's a little confusing on why that is needed.

Checklist

Current Behavior

Works as expected

Expected Behavior

Works as expected

Possible Solution

Remove the mean returned in the get_action function in Actor class

@dosssman
Copy link
Collaborator

Greetings.
Sorry for the late answer.

In the original implementation, the mean is used for deterministic evaluation of the agent.
Intuitively, using mean corresponds to the greediest policy, and would results in maximal performance.

While CleanRL directly uses the episodic return collected during training (i.e. stochastic action sampling), the mean
is left for compatibility with original implementation.

Leaving mean in the code should also help facilitate researchers who build on top of it to directly access it if they need it for their experiments / evaluation.

Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants