-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathNN_AI.py
More file actions
47 lines (35 loc) · 1.61 KB
/
NN_AI.py
File metadata and controls
47 lines (35 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
## Planning Stage
## State Representation
"""
What's visible to the human player is the board with tiles on them, and
the information of what's the next tile that will be added to the board.
To have a presentation at this level, I just need to flatten the board
information into a list and then add another element to the list to
represent the next tile.
However, this is not all the information available to a really clever
and dedicated human player. That player might track which tiles are has
already been seen. They could work out the frequencies of the tiles, and
reconstruct the TileDeck structure and play ahead even more.
To mirror this player, I would need to flatten the board, add a next
tile, a list to present all the tiles that are yet to be drawn from the
current deck, and a counter to warn again bonus decks.
"""
## NN Representation
"""
Assuming that I have M features in my state representation, a NN would
then have M nodes in the first layer. There are only four decisions to
make in the game: swipe left, right, up and down. The last layer need to
have 4 nodes. There could be any number of in between layers.
"""
## Marking Success
"""
The NN_AI player would need to know how to make valid moves. Through the
operations of the NN, it will only make valid moves.
The NN_AI player will also ideally be a good player of Threes! It will
need to make moves that make the game last as long as possible.
"""
## Implementation
"""
I think I should use numpy to implement my NN and training algorithms.
It feels unprofitable at this point to implement my own matrix library.
"""