ml-agents icon indicating copy to clipboard operation
ml-agents copied to clipboard

Can action space be Tuple of Boxes instead of a Box ?

Open armando-fandango opened this issue 4 years ago • 2 comments

Is your feature request related to a problem? Please describe. Currently, we have a situation where actions space has three elements. Two elements are -1,1 range and the third element is 0,1 range. But we cant implement it as GUI in Unity only allows for Box and not Tuple of Boxes.

Describe the solution you'd like Action space should allow a tuple of boxes.

Describe alternatives you've considered We are clamping the third value on unity side to be between 0,1 but that creates a biased sampling when we sample through env.action_space.sample(), because then all the values from -1,0 get clamped to 0, thus distroting the sampling and creating a biased sampling.

armando-fandango avatar Jul 07 '21 02:07 armando-fandango

An easy solution to this would be to just take the action that goes from -1 to 1, add 1, and divide by 2. That will get you a 0-1 centered around 0.5. Only do this for your third action.

ervteng avatar Jul 20 '21 22:07 ervteng

Thx. That's what we are doing for now.

armando-fandango avatar Jul 21 '21 13:07 armando-fandango