Giter Site home page Giter Site logo

Env.step() with no action about gym HOT 6 CLOSED

openai avatar openai commented on May 20, 2024 6
Env.step() with no action

from gym.

Comments (6)

keleftheriou avatar keleftheriou commented on May 20, 2024 1

I've only been playing with the 'CartPole-v0' environment so far, and that has an action_space of spaces.Discrete(2) which led me to my comment.

I wonder if making Env.step() have action=None as a default could work, letting the environment complain if it can't accept it. The API would be more general this way, and the potential for API misuse by either environment users or environment authors seems low.

Alternatively, 'CartPole-v0' could just be changed to take a Box action_space instead of a Discrete one, although it feels like this particular environment might have been purposefully made to not take variable force values.

Good to know about the mujoco environments utilizing a notion of "effort" through the reward returned, thanks.

from gym.

jonasschneider avatar jonasschneider commented on May 20, 2024

This seems like it's mostly a semantic issue with env action spaces. In some envs, "not acting" is meaningless -- take board games like Chess or Go (the latter we have as an env already) for example: if it's your turn, you can't meaningfully choose to "not act".

Also, efficiency/effort are ill-defined concepts whose semantics depend on the env. In fact, what you propose is already implemented in some envs. For example, the mujoco envs penalize you (i.e. reduce reward) based on the joint torques that you specify, i.e. what could intuitively be described as the "effort".

So it seems like this is a per-env semantic issue. We're happy about proposals for definitions of efficiency for specific envs, though!

from gym.

tlbtlbtlb avatar tlbtlbtlb commented on May 20, 2024

In (I think) all the physics environments the actions are converted to torques, so a vector of 0s is a reasonable least-effort action. That might not be obvious from the action_space, which usually is a Box with low=[-1, ...] and high=[+1, ...].

from gym.

gdb avatar gdb commented on May 20, 2024

The feedback makes sense; thanks for the input!

This isn't part of the standard formulation of RL, so I think for now we shouldn't add it (and I'm not sure if it'd make sense for every env). I'm going to close for now, but if we see more demand for something like this, we'll revisit!

from gym.

ivanvoid avatar ivanvoid commented on May 20, 2024

@gdb so you wanna say this issue was never resolved?
Yea 4 years later, please add option to stay still in 'CartPole-v1',
or just help to figure out how to make it possible, this also will be really appreciated.

This option really integral for development of Event-Triggered Control RL systems,
I would say this would help a lot making this Cart Pole a benchmark for those applications.

from gym.

soroush-bn avatar soroush-bn commented on May 20, 2024

@gdb I came across the same problem when I want to add additional actions for "Taxi" environment, I want to add diagonal movements to the grid world, however, it is not possible to perform such action when agent is on the edge of the grid, thus, whether I need to create my custom env or use a "NOOP" action and pass it to env.step() function to see the observation and etc.

from gym.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.