-
Notifications
You must be signed in to change notification settings - Fork 4.4k
GridWorld now uses action masking #1125
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
Conversation
mmattar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the tensorboard comparison graphs?
| var positionX = (int) transform.position.x; | ||
| var positionZ = (int) transform.position.z; | ||
| var maxPosition = academy.gridSize - 1; | ||
| if (positionX == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the constants 0 -> 3 in the conditionals (if position...) and in SetActionMask should be class static variables.
| int action = Mathf.FloorToInt(vectorAction[0]); | ||
|
|
||
| // 0 - Forward, 1 - Backward, 2 - Left, 3 - Right | ||
| Vector3 targetPos = transform.position; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this comment
| // Prevents the agent from picking an action that would make it collide with a wall | ||
| var positionX = (int) transform.position.x; | ||
| var positionZ = (int) transform.position.z; | ||
| var maxPosition = academy.gridSize - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can the grid size be changed at runtime? If not, move this to InitializeAgent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be changed at runtime yes. It is one of the reset maramiters.
* Added checkbox to turn action masking on/off * Fix to handle the no-action option
Action masking makes GridWorld learn faster because it does not waste time bumping into walls.
