Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • C clients
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • QuanserQuanser
  • clients
  • Merge requests
  • !4

Unify API for actions and observations

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Michael Lutter requested to merge unify_api into master Dec 04, 2018
  • Overview 1
  • Commits 3
  • Changes 9

Hey,

students told me that our API is not consistent for observations and actions. So I unified the checks for actions on all environments (at least to the best of my knowledge). So every environment checks the action via:

assert a is not None, "Action should be not None"
assert isinstance(a,np.ndarray), "The action should be a ndarray"
assert np.all(not np.isnan(a)), "Action NaN is not a valid action"
assert a.ndim == 1, "The action = {1} must be 1d but the input is {0:d}d".format(a.ndim, a)

In addition, the observation is now guaranteed to be an np.array. You can test this by running the python script unify_api.py.

@muratore @abdulsamad @belousov @tosatto Are you ok with that? If nobody complains, I will merge it to master. And sorry that I made such a mess with the commits.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: unify_api