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

Eval stats collector #80

Merged
merged 10 commits into from
Nov 12, 2020
Merged

Conversation

prabhatnagarajan
Copy link
Contributor

We currently collect basic performance statistics as well as agent statistics. This PR allows environment statistics to be collected. This gives a lot of flexibility. For example, if you have a binary success task such as grasping, your environment could give a "success" statistic, in addition to the reward. If you have a finance domain, your environment could track "profit" separate from the reward function.

The environment optionally implements two functions: get_statistics and clear_statistics. If these functions are not implemented, then the evaluator works as it did before (i.e. this PR is backwards compatible).

  • get_statistics: Returns the environment statistics. Defaults to returning an empty list if the environment doesn't implement it.
  • clear_statistics: Clears the statistics. This is called before evaluation so that get_statistics only returns statistics collected during evaluation. By default does nothing if clear_statistics isn't implemented by the environment.

@github-actions github-actions bot requested a review from muupan October 7, 2020 05:14
@prabhatnagarajan
Copy link
Contributor Author

/test

@pfn-ci-bot
Copy link

Successfully created a job for commit 3326b59:

@prabhatnagarajan
Copy link
Contributor Author

/test

@pfn-ci-bot
Copy link

Successfully created a job for commit 53eaa8a:

@prabhatnagarajan
Copy link
Contributor Author

/test

@pfn-ci-bot
Copy link

Successfully created a job for commit 88ce4cb:

@prabhatnagarajan
Copy link
Contributor Author

/test

@pfn-ci-bot
Copy link

Successfully created a job for commit fe82aba:

@prabhatnagarajan
Copy link
Contributor Author

/test

@pfn-ci-bot
Copy link

Successfully created a job for commit 2b7b0f7:

Copy link
Member

@muupan muupan left a comment

Choose a reason for hiding this comment

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

The new API looks good, and I verified it works by writing a wrapper that calculates success rate for OpenAI Gym robot env: https://github.com/muupan/pfrl/blob/her-fetch/examples/her/train_ddpg_her_fetch.py#L15

@muupan muupan merged commit 7b2d734 into pfnet:master Nov 12, 2020
@prabhatnagarajan prabhatnagarajan deleted the eval_stats_collector branch November 12, 2020 09:57
@muupan muupan added the enhancement New feature or request label Dec 11, 2020
@muupan muupan added this to the v0.2.0 milestone Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants