Skip to content
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

Chapter 3 - Not learning with larger grid (size = 12) #38

Open
daniel-xion opened this issue Jun 23, 2022 · 3 comments
Open

Chapter 3 - Not learning with larger grid (size = 12) #38

daniel-xion opened this issue Jun 23, 2022 · 3 comments

Comments

@daniel-xion
Copy link

daniel-xion commented Jun 23, 2022

When I change the size to 12 (and in the mode = "player"), the agent no longer learning. It always move towards the borders, i.e. keep taking the action moving towards the borders even when it is already at the border.
Is it because there is no penalty for such action?

@daniel-xion
Copy link
Author

image

@daniel-xion
Copy link
Author

I added the following penalty and it is still not working:

if (self.board.components['Player'].pos[0] < 0 or self.board.components['Player'].pos[1] < 0 or self.board.components['Player'].pos[0] > self.board.size-1 or self.board.components['Player'].pos[1] > self.board.size-1) :
            
return -10

@outlace
Copy link
Collaborator

outlace commented Nov 29, 2022

This is likely due to the fact that with a larger grid size it becomes increasingly rare for the agent to randomly hit the goal, which we need it to do a few times for the algorithm to learn. When the grid is too large, a random walk will almost never hit the goal. To solve large grids with very sparse rewards you will have to implement some of the more advanced techniques like curiosity that are covered later in the book.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants