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

support for deterministic inference in onnx #5593

Conversation

maryamhonari
Copy link
Contributor

@maryamhonari maryamhonari commented Oct 22, 2021

Proposed change(s)

Serialize two output tensors to onnx for deterministic actions:

  • "deterministic_continuous_actions"
  • "deterministic_discrete_actions"

ℹ️  changes to com.unity.ml-agents on a separate PR 

Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)

Types of change(s)

  • Bug fix
  • New feature
  • Code refactor
  • Breaking change
  • Documentation update
  • Other (please describe)

Checklist

  • Added tests that prove my fix is effective or that my feature works
  • Updated the changelog (if applicable)
  • Updated the documentation (if applicable)
  • Updated the migration guide (if applicable)

Other comments

@maryamhonari maryamhonari changed the title Init: actor.forward outputs separate deterministic actions support for deterministic inference in onnx Oct 22, 2021
@maryamhonari maryamhonari changed the base branch from main to develop-staging-determinstic-action October 25, 2021 21:12
@cmard cmard force-pushed the develop-staging-determinstic-action branch from 9160d85 to 7e7c3e2 Compare October 27, 2021 13:54
@maryamhonari maryamhonari changed the base branch from develop-staging-determinstic-action to deterministic-actions-python-training October 28, 2021 19:43
@maryamhonari maryamhonari marked this pull request as ready for review October 28, 2021 19:51
Copy link
Collaborator

@miguelalonsojr miguelalonsojr left a comment

Choose a reason for hiding this comment

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

Can you add test to cover these changes?

ml-agents/mlagents/trainers/torch/action_model.py Outdated Show resolved Hide resolved
ml-agents/mlagents/trainers/torch/action_model.py Outdated Show resolved Hide resolved
ml-agents/mlagents/trainers/torch/action_model.py Outdated Show resolved Hide resolved
ml-agents/mlagents/trainers/torch/action_model.py Outdated Show resolved Hide resolved
ml-agents/mlagents/trainers/torch/action_model.py Outdated Show resolved Hide resolved
ml-agents/mlagents/trainers/torch/action_model.py Outdated Show resolved Hide resolved
ml-agents/mlagents/trainers/torch/action_model.py Outdated Show resolved Hide resolved
ml-agents/mlagents/trainers/torch/distributions.py Outdated Show resolved Hide resolved
ml-agents/mlagents/trainers/torch/networks.py Outdated Show resolved Hide resolved
@maryamhonari maryamhonari force-pushed the develop-deterministic-policy-editor branch from 20fce24 to fb7849f Compare November 2, 2021 23:30
@cmard cmard force-pushed the deterministic-actions-python-training branch from bf15d2e to 604d7c1 Compare November 15, 2021 23:06
@maryamhonari maryamhonari merged commit 0f5cd2b into deterministic-actions-python-training Nov 16, 2021
@delete-merged-branch delete-merged-branch bot deleted the develop-deterministic-policy-editor branch November 16, 2021 22:17
maryamhonari added a commit that referenced this pull request Nov 18, 2021
* Init: actor.forward outputs separate deterministic actions

* changelog

* Renaming

* Add more tests
maryamhonari added a commit that referenced this pull request Nov 18, 2021
* Init: actor.forward outputs separate deterministic actions

* changelog

* Renaming

* Add more tests
maryamhonari added a commit that referenced this pull request Nov 18, 2021
* Progress on propagating the setting to the action model.

* Added the _sample_action logic and tests.

* Add information to the changelog.

* Prioritize the CLI over the configuration file.

* Update documentation for config file.

* CR refactor.

* Update docs/Training-Configuration-File.md

Co-authored-by: Miguel Alonso Jr. <76960110+miguelalonsojr@users.noreply.github.com>
Update com.unity.ml-agents/CHANGELOG.md

Co-authored-by: Miguel Alonso Jr. <76960110+miguelalonsojr@users.noreply.github.com>
Update com.unity.ml-agents/CHANGELOG.md

Co-authored-by: Miguel Alonso Jr. <76960110+miguelalonsojr@users.noreply.github.com>
Update com.unity.ml-agents/CHANGELOG.md

Co-authored-by: Maryam Honari <honari.m94@gmail.com>
Update ml-agents/mlagents/trainers/settings.py

Co-authored-by: Maryam Honari <honari.m94@gmail.com>
Update ml-agents/mlagents/trainers/cli_utils.py

Co-authored-by: Maryam Honari <honari.m94@gmail.com>

* Fix CR requests

* Add tests for discrete.

* Update ml-agents/mlagents/trainers/torch/distributions.py

Co-authored-by: Maryam Honari <honari.m94@gmail.com>

* Added more stable test.

* Return deterministic actions for training (#5615)

* Added more stable test.

* Fix the tests.

* Fix pre-commit

* Fix help line to pass precommit.

* support for deterministic inference in onnx (#5593)

* Init: actor.forward outputs separate deterministic actions

* changelog

* Renaming

* Add more tests

* Package changes to support deterministic inference (#5599)

* Init: actor.forward outputs separate deterministic actions

* fix tensor shape for discrete actions

* Add test and editor flag

- Add tests for deterministic sampling
- update editor and tooltips

* Reverting to "Deterministic Inference"

* dissect tests

* Update docs

* Update CHANGELOG.md

Co-authored-by: Chingiz Mardanov <chingiz.mardanov@unity3d.com>
Co-authored-by: cmard <87716492+cmard@users.noreply.github.com>
miguelalonsojr pushed a commit that referenced this pull request Dec 2, 2021
* Progress on propagating the setting to the action model.

* Added the _sample_action logic and tests.

* Add information to the changelog.

* Prioritize the CLI over the configuration file.

* Update documentation for config file.

* CR refactor.

* Update docs/Training-Configuration-File.md

Co-authored-by: Miguel Alonso Jr. <76960110+miguelalonsojr@users.noreply.github.com>
Update com.unity.ml-agents/CHANGELOG.md

Co-authored-by: Miguel Alonso Jr. <76960110+miguelalonsojr@users.noreply.github.com>
Update com.unity.ml-agents/CHANGELOG.md

Co-authored-by: Miguel Alonso Jr. <76960110+miguelalonsojr@users.noreply.github.com>
Update com.unity.ml-agents/CHANGELOG.md

Co-authored-by: Maryam Honari <honari.m94@gmail.com>
Update ml-agents/mlagents/trainers/settings.py

Co-authored-by: Maryam Honari <honari.m94@gmail.com>
Update ml-agents/mlagents/trainers/cli_utils.py

Co-authored-by: Maryam Honari <honari.m94@gmail.com>

* Fix CR requests

* Add tests for discrete.

* Update ml-agents/mlagents/trainers/torch/distributions.py

Co-authored-by: Maryam Honari <honari.m94@gmail.com>

* Added more stable test.

* Return deterministic actions for training (#5615)

* Added more stable test.

* Fix the tests.

* Fix pre-commit

* Fix help line to pass precommit.

* support for deterministic inference in onnx (#5593)

* Init: actor.forward outputs separate deterministic actions

* changelog

* Renaming

* Add more tests

* Package changes to support deterministic inference (#5599)

* Init: actor.forward outputs separate deterministic actions

* fix tensor shape for discrete actions

* Add test and editor flag

- Add tests for deterministic sampling
- update editor and tooltips

* Reverting to "Deterministic Inference"

* dissect tests

* Update docs

* Update CHANGELOG.md

* Fix the deterministic showing up all the tiime (#5621)

Co-authored-by: Chingiz Mardanov <chingiz.mardanov@unity3d.com>
Co-authored-by: cmard <87716492+cmard@users.noreply.github.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants