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

Develop hybrid action staging #4702

Merged
merged 16 commits into from
Dec 9, 2020
Merged

Conversation

andrewcoh
Copy link
Contributor

@andrewcoh andrewcoh commented Dec 3, 2020

Proposed change(s)

Hybrid Actions staging branch

To merge in before it is ready to merge into master:

  • ActionTuple
  • ActionModel
  • C#

TODO:

  • Merge master Addressing clipped actions was non-trivial. Please look at how ActionInfo and clipping in the torch policy has changed.
  • Fix GAIL simple RL (after C#) (GAIL tests passed but still using demonstrations with old proto fields)
  • (may come later or separate PR) Update the demo files
  • Docs
  • Env (in 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

andrewcoh and others added 3 commits November 16, 2020 15:46
Co-authored-by: Ervin T <ervin@unity3d.com>
Co-authored-by: Vincent-Pierre BERGES <vincentpierre@unity3d.com>
Co-authored-by: Ervin T <ervin@unity3d.com>
Co-authored-by: Vincent-Pierre BERGES <vincentpierre@unity3d.com>
@andrewcoh andrewcoh closed this Dec 4, 2020
@andrewcoh andrewcoh reopened this Dec 4, 2020
@andrewcoh andrewcoh closed this Dec 4, 2020
@andrewcoh andrewcoh reopened this Dec 4, 2020
andrewcoh and others added 12 commits December 4, 2020 11:04
* Add hybrid action capability flag (#4576)

* Change BrainParametersProto to support ActionSpec (#4579)

* Assign new BrainParametersProto fields based on capabilities (#4581)

* ActionBuffer with hybrid actions for RemotePolicy (#4592)

* Barracuda inference for hybrid actions (#4611)

* Refactor BarracudaModel loader checks (#4629)

* Export separate nodes for continuous/discrete actions (#4655)

* Separate continuous/discrete actions in AgentActionProto (#4698)

* Force different nodes for new and deprecated action output (#4705)
* clean up docs on actions, code examples, reference to hybrid

* undo change from other branch

* Update docs/Python-API.md

Co-authored-by: andrewcoh <54679309+andrewcoh@users.noreply.github.com>

* Update docs/Python-API.md

Co-authored-by: andrewcoh <54679309+andrewcoh@users.noreply.github.com>

* Update docs/Python-API.md

Co-authored-by: andrewcoh <54679309+andrewcoh@users.noreply.github.com>

* Update docs/Python-API.md

Co-authored-by: andrewcoh <54679309+andrewcoh@users.noreply.github.com>

* cleanup

Co-authored-by: andrewcoh <54679309+andrewcoh@users.noreply.github.com>
has_nan = np.isnan(d)
if has_nan:
raise RuntimeError("Continuous NaN action detected.")
d = np.sum(action.discrete)
Copy link
Contributor

Choose a reason for hiding this comment

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

action.discrete is int32's right? I don't think we need to check them for NaNs

Copy link
Contributor

Choose a reason for hiding this comment

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

(OK to do after merging to master)

- Actions can either use `Discrete` or `Continuous` spaces.
- When using `Discrete` it is possible to assign multiple action branches, and
to mask certain actions.
- Agents can either use `Discrete` or `Continuous` actions.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Agents can either use `Discrete` or `Continuous` actions.
- Agents can use `Discrete` and/or `Continuous` actions.

action. For example : In a game direction input (no movement, left, right) and
- `action_spec` is an `ActionSpec` namedtuple that defines the number and types
of actions for the Agent.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#### ActionSpec

Copy link
Contributor

@dongruoping dongruoping left a comment

Choose a reason for hiding this comment

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

Changelog hasn't been updated yet.

@andrewcoh
Copy link
Contributor Author

Changelog hasn't been updated yet.

I'll update in a subsequent PR.

Copy link
Contributor

@ervteng ervteng left a comment

Choose a reason for hiding this comment

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

:shipit:

@andrewcoh andrewcoh merged commit 81d8ef5 into master Dec 9, 2020
@delete-merged-branch delete-merged-branch bot deleted the develop-hybrid-action-staging branch December 9, 2020 22:13
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 10, 2021
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.

None yet

4 participants