Default Action option missing in Brain->Player->Discrete Action Space
Hi,
The default action under 'Edit the discrete inputs for your actions' is missing in the current main branch. Because of this I am not able to test my agent under the Player Brain. Can anyone confirm if this is true, or am I missing something?
Regards
Hi @hsaikia , thanks for the note. Yes you are correct, we've removed the default action since v0.5. The reason is with discrete action now it is possible that we can have multiple branches, and it would be really verbose if people have to specify multiple default action for each of these branches. Since v0.5, we've made the action index 0 as the default action. Maybe we need to update our migration doc to explain this....
Hi @xiaomaogy , thanks for the reply. This is fine. I found a workaround for this (which should be possible for everyone else). I indexed my actions starting from 1 and added an extra action. So, for instance, with 4 actions I now set aside space for 5 actions and index my actions from 1 through 4 with 0 being the default.
@hsaikia Yes, that's the standard way of migrating from v0.4 to v0.5 for discrete control. (Actually we did this during our upgrade for all of our example environments. )
Yeah I ran into the same experience. Might be handy to add to the migration info, or in general to the documentation about branching.
@vincentpierre
I indexed my actions starting from 1 and added an extra action. So, for instance, with 4 actions I now set aside space for 5 actions and index my actions from 1 through 4 with 0 being the default.
that will work in Player brain type while testing out the inputs...but it fail for when training with External brain type. It messes up the array sequence cos' Tensorflow returns with index of 0, 1, 2...but Player mode starts off with 0 as default, i can't set it to -1.
actually i don't see how default will affect multiple branches...default is a value specifically for AgentAction to ignore when there are no inputs.
When using the External Brain with discrete control, the actions will be an array of indices. If there is one branch with 5 actions (0,1,2,3,4) 0 can be the default (just like with the player brain) and 1,2,3,4 can be the actual actions (example : up, down, right, left). Player Brain and External Brain are supposed to have the same range of possible actions. This is why -1 is no longer the default, because the External Brain could not produce -1.
Note that with multi-branches each branch has the default action of 0.
Does that answer your question?
..ah i see...got it. thanks, i'll just +1 to the indices returned from External brain.
Thanks for reaching out to us. Hopefully you were able to resolve your issue. We are closing this due to inactivity, but if you need additional assistance, feel free to reopen the issue.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.