Machine learning: Q table
Posted: Tue Jul 27, 2021 3:44 am
So been reading up about machine learning and Q tables:
https://en.wikipedia.org/wiki/Q-learning#Algorithm
I want to have an AI in my current project that, when faced with a combination of states, it will learn how to react for a positive outcome. To avoid confusion, I will be defining a known set of finite states and a known set of finite actions. I intend to build a Q table.
The learning initially will be random and AI behavior will be terrible but, arguably, no worse than any other random AI bot. As actions are taken and evaluated, the Q table will populate and the Q table can give the bot meaningful instructions under a set of finite states.
Here is my question:
It's easy to think of a Q table as a series of states (singular) in the sense that there is only one thing to compute. For example, when navigating a maze, the tile next the bot can have a range of states:
- tile is blocked
- tile is closer to the goal
- tile is further from the goal
- tile is neither closer or further from the goal
Whilst their are four possible outcomes, there is only one concept being tested: a tile, or specifically, the tile next to the bot.
I want to make my Q table more complex and meaningful by testing more than one concept. I want to test the tile next to me AND the proximity of some monster that needs to be avoided (I'm making up an example ).
So how to do a Q table? Now, with more information, this state:
- neighboring tile is closer to the goal
may not be the best option if
- neighboring tile is closer to the monster.
With this new criteria, i would change the scoring so that moving closer to the monster is always bad (this is theoretical - lets ignore that the bot may never reach the goal this way).
Getting to the point: how to construct a Q table when there are multiple 'concepts' a bot needs to check before taking an action?
https://en.wikipedia.org/wiki/Q-learning#Algorithm
I want to have an AI in my current project that, when faced with a combination of states, it will learn how to react for a positive outcome. To avoid confusion, I will be defining a known set of finite states and a known set of finite actions. I intend to build a Q table.
The learning initially will be random and AI behavior will be terrible but, arguably, no worse than any other random AI bot. As actions are taken and evaluated, the Q table will populate and the Q table can give the bot meaningful instructions under a set of finite states.
Here is my question:
It's easy to think of a Q table as a series of states (singular) in the sense that there is only one thing to compute. For example, when navigating a maze, the tile next the bot can have a range of states:
- tile is blocked
- tile is closer to the goal
- tile is further from the goal
- tile is neither closer or further from the goal
Whilst their are four possible outcomes, there is only one concept being tested: a tile, or specifically, the tile next to the bot.
I want to make my Q table more complex and meaningful by testing more than one concept. I want to test the tile next to me AND the proximity of some monster that needs to be avoided (I'm making up an example ).
So how to do a Q table? Now, with more information, this state:
- neighboring tile is closer to the goal
may not be the best option if
- neighboring tile is closer to the monster.
With this new criteria, i would change the scoring so that moving closer to the monster is always bad (this is theoretical - lets ignore that the bot may never reach the goal this way).
Getting to the point: how to construct a Q table when there are multiple 'concepts' a bot needs to check before taking an action?