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

feat(statistics tools): support statistics tools for experiments launched by omnisafe #157

Merged
merged 49 commits into from
Mar 27, 2023

Conversation

muchvo
Copy link
Collaborator

@muchvo muchvo commented Mar 17, 2023

Description

  1. Support statistics tools for experiments launched by omnisafe.
    Once finished experiments are launched by the experiment grid, users can utilize statistics tools to compare the effect of any parameter. Enjoy these tools which boost your efficiency of running experiments!
    Here is an example:
    image
    Then you can get the graphs you want in seconds.
    image
    image

Motivation and Context

Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
You can use the syntax close #15213 if this solves the issue #15213

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds core functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)

Implemented Tasks

  • Subtask 1
  • Subtask 2
  • Subtask 3

Checklist

Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!

  • I have read the CONTRIBUTION guide. (required)
  • My change requires a change to the documentation.
  • I have updated the tests accordingly. (required for a bug fix or a new feature)
  • I have updated the documentation accordingly.
  • I have reformatted the code using make format. (required)
  • I have checked the code using make lint. (required)
  • I have ensured make test pass. (required)

rockmagma02 and others added 17 commits March 15, 2023 02:53
Co-authored-by: borong <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: ruiyang sun <[email protected]>
Co-authored-by: zmsn-2077 <[email protected]>
Co-authored-by: borong <[email protected]>
Co-authored-by: friedmainfunction <[email protected]>
…nment#147)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…thms (PKU-Alignment#148)

Co-authored-by: borong <[email protected]>
Co-authored-by: Gaiejj <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: zmsn-2077 <[email protected]>
@friedmainfunction friedmainfunction changed the title feat(statistics tools): support statistics tools for experiments launched by omnisafe. feat(statistics tools): support statistics tools for experiments launched by omnisafe Mar 18, 2023
Gaiejj and others added 2 commits March 18, 2023 10:02
Co-authored-by: borong <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: ruiyang sun <[email protected]>
Co-authored-by: zmsn-2077 <[email protected]>
Co-authored-by: friedmainfunction <[email protected]>
Co-authored-by: Gaiejj <[email protected]>
Co-authored-by: zmsn-2077 <[email protected]>
Co-authored-by: Ruiyang Sun <[email protected]>
Co-authored-by: Jiayi Zhou <[email protected]>
Co-authored-by: 1Asan <[email protected]>
fix(algo): fix no return in algo_wrapper::learn (PKU-Alignment#122)
fix(logger, wrapper): support csv file and velocity tasks (PKU-Alignment#131)
fix typo. (PKU-Alignment#134)
fix(ppo): fix entropy loss (PKU-Alignment#135)
fix bugs (PKU-Alignment#136)
fix: support new config for exp_grid (PKU-Alignment#142)
fix(rollout, exp_grid): fix logdir path conflict (PKU-Alignment#145)
fix(on-policy): fix the second order algorithms performance (PKU-Alignment#147)
@codecov
Copy link

codecov bot commented Mar 19, 2023

Codecov Report

Patch coverage: 82.80% and project coverage change: -0.22 ⚠️

Comparison is base (e6b07a7) 86.32% compared to head (a54c122) 86.11%.

❗ Current head a54c122 differs from pull request most recent head 6cfa4f2. Consider uploading reports for the commit 6cfa4f2 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #157      +/-   ##
==========================================
- Coverage   86.32%   86.11%   -0.22%     
==========================================
  Files          80       82       +2     
  Lines        3760     4111     +351     
==========================================
+ Hits         3246     3540     +294     
- Misses        514      571      +57     
Impacted Files Coverage Δ
omnisafe/utils/command_app.py 75.55% <61.90%> (-4.70%) ⬇️
omnisafe/utils/plotter.py 72.58% <72.58%> (ø)
omnisafe/utils/tools.py 86.77% <85.71%> (+5.33%) ⬆️
omnisafe/common/statistics_tools.py 88.41% <88.41%> (ø)
omnisafe/algorithms/algo_wrapper.py 92.85% <100.00%> (+1.19%) ⬆️
omnisafe/common/experiment_grid.py 89.57% <100.00%> (+1.09%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Dtrc2207 and others added 5 commits March 19, 2023 17:13
…lignment#162)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: borong <[email protected]>
Co-authored-by: borong <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: ruiyang sun <[email protected]>
Co-authored-by: zmsn-2077 <[email protected]>
Co-authored-by: friedmainfunction <[email protected]>
Co-authored-by: Gaiejj <[email protected]>
Co-authored-by: zmsn-2077 <[email protected]>
Co-authored-by: Ruiyang Sun <[email protected]>
Co-authored-by: Jiayi Zhou <[email protected]>
Co-authored-by: 1Asan <[email protected]>
fix(algo): fix no return in algo_wrapper::learn (PKU-Alignment#122)
fix(logger, wrapper): support csv file and velocity tasks (PKU-Alignment#131)
fix typo. (PKU-Alignment#134)
fix(ppo): fix entropy loss (PKU-Alignment#135)
fix bugs (PKU-Alignment#136)
fix: support new config for exp_grid (PKU-Alignment#142)
fix(rollout, exp_grid): fix logdir path conflict (PKU-Alignment#145)
fix(on-policy): fix the second order algorithms performance (PKU-Alignment#147)
…lignment#162)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: borong <[email protected]>
muchvo and others added 2 commits March 20, 2023 00:54
…lignment#164)

Co-authored-by: borong <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
muchvo and others added 7 commits March 26, 2023 18:18
* refactor(wrapper): refactor the cuda setting

* chore: revert train_policy.py

* chore: set device in safety_gymnasium_env.py

* fix: [pre-commit.ci] auto fixes [...]

* fix(safety_gymnasium_env.py): fix device interface

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@Gaiejj Gaiejj self-requested a review March 27, 2023 08:04
omnisafe train-config ./saved_source/train_config.yaml
```


Copy link
Member

Choose a reason for hiding this comment

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

Please delete this duplicate part.

"vector_env_nums": 2
},
"logger_cfgs": {
"log_dir": "/home/borong/code/pr_typer_3_16/omnisafe/benchmark/test_statistics_tools/SafetyAntVelocity-v4:::763a242578801da3979d68673a8eb89474ab4570fe6d3fa9a686117f63020872/"
Copy link
Member

Choose a reason for hiding this comment

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

Is the log_dir needed to be change?

Copy link
Member

@Gaiejj Gaiejj left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Member

@zmsn-2077 zmsn-2077 left a comment

Choose a reason for hiding this comment

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

LGTM.

@friedmainfunction friedmainfunction merged commit c3993bf into PKU-Alignment:dev Mar 27, 2023
@friedmainfunction friedmainfunction deleted the support_statistics_tools branch March 27, 2023 08:27
zmsn-2077 pushed a commit that referenced this pull request Mar 27, 2023
Gaiejj added a commit that referenced this pull request Mar 28, 2023
* feat(statistics tools): support statistics tools for experiments launched by omnisafe (#157)

* docs: update API documentation

* chore: clean the code

* fix: fix duplicate files

* fix: delete duplicate conf.py

* docs: update tools docs

* chore: clean the docs

* docs: update app docs

* fix: fix conf.py

* fix: fix cli docs

* docs: update omnisafe usage

* fix: [pre-commit.ci] auto fixes [...]

* refactor: refactor docs structure

* docs(foundations): rename docs file

* docs: update introduction

* fix: [pre-commit.ci] auto fixes [...]

* fix: fix spelling

* fix: [pre-commit.ci] auto fixes [...]

* fix: fix code block

* docs: update comment

---------

Co-authored-by: muchvo <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Gaiejj added a commit that referenced this pull request Mar 28, 2023
* feat(statistics tools): support statistics tools for experiments launched by omnisafe (#157)

* docs: update API documentation

* chore: clean the code

* fix: fix duplicate files

* fix: delete duplicate conf.py

* docs: update tools docs

* chore: clean the docs

* docs: update app docs

* fix: fix conf.py

* fix: fix cli docs

* docs: update omnisafe usage

* fix: [pre-commit.ci] auto fixes [...]

* refactor: refactor docs structure

* docs(foundations): rename docs file

* docs: update introduction

* fix: [pre-commit.ci] auto fixes [...]

* fix: fix spelling

* fix: [pre-commit.ci] auto fixes [...]

* fix: fix code block

* docs: update comment

---------

Co-authored-by: muchvo <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Gaiejj added a commit that referenced this pull request Mar 31, 2023
* feat(statistics tools): support statistics tools for experiments launched by omnisafe (#157)

* docs: update API documentation

* chore: clean the code

* fix: fix duplicate files

* fix: delete duplicate conf.py

* docs: update tools docs

* chore: clean the docs

* docs: update app docs

* fix: fix conf.py

* fix: fix cli docs

* docs: update omnisafe usage

* fix: [pre-commit.ci] auto fixes [...]

* refactor: refactor docs structure

* docs(foundations): rename docs file

* docs: update introduction

* fix: [pre-commit.ci] auto fixes [...]

* fix: fix spelling

* fix: [pre-commit.ci] auto fixes [...]

* fix: fix code block

* docs: update comment

* docs: fix ggrammer

* docs(models, envs): update api docs

* docs: update title

* docs: update model docs

* docs(adapters): update API docs

* style: clean the docs

* fix: revert ruff

* docs: fix spelling

* docs: update start example

* docs: fix typo

* docs: update notation table

* docs: fix notation table

* docs(CUP): update cup docs

* docs(TRPO): update trpo docs

* fix: fix exp grid

* fix: fix exp grid

* chore: update version

---------

Co-authored-by: muchvo <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
muchvo added a commit that referenced this pull request Apr 1, 2023
* feat(statistics tools): support statistics tools for experiments launched by omnisafe (#157)

* docs: update API documentation

* chore: clean the code

* fix: fix duplicate files

* fix: delete duplicate conf.py

* docs: update tools docs

* chore: clean the docs

* docs: update app docs

* fix: fix conf.py

* fix: fix cli docs

* docs: update omnisafe usage

* fix: [pre-commit.ci] auto fixes [...]

* refactor: refactor docs structure

* docs(foundations): rename docs file

* docs: update introduction

* fix: [pre-commit.ci] auto fixes [...]

* fix: fix spelling

* fix: [pre-commit.ci] auto fixes [...]

* fix: fix code block

* docs: update comment

* docs: fix ggrammer

* docs(models, envs): update api docs

* docs: update title

* docs: update model docs

* docs(adapters): update API docs

* style: clean the docs

* fix: revert ruff

* docs: fix spelling

* docs: update start example

* docs: fix typo

* docs: update notation table

* docs: fix notation table

* docs(CUP): update cup docs

* docs(TRPO): update trpo docs

* fix: fix exp grid

* fix: fix exp grid

* chore: update version

---------

Co-authored-by: muchvo <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Gaiejj pushed a commit to Gaiejj/omnisafe_zjy that referenced this pull request Apr 11, 2023
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

Successfully merging this pull request may close these issues.

8 participants