-
Notifications
You must be signed in to change notification settings - Fork 0
add exps, make tweaks, fix bug in game.apply action where pickup can … #4
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
Open
TaylorKNoah
wants to merge
2
commits into
main
Choose a base branch
from
feature/add-initial-experiments-and-tweaks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,6 @@ | ||
| *.pyc | ||
| *.vscode | ||
| *.vscode | ||
| env | ||
| env/* | ||
| __pycache__ | ||
| __pycache__/* |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.5 KB
...riementResults/BatchSize/Games256/Agent_Average_Score_Per_Move_Per_Game_BS1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+57.5 KB
...iementResults/BatchSize/Games256/Agent_Average_Score_Per_Move_Per_Game_BS16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+54.7 KB
...iementResults/BatchSize/Games256/Agent_Average_Score_Per_Move_Per_Game_BS32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+57 KB
...riementResults/BatchSize/Games256/Agent_Average_Score_Per_Move_Per_Game_BS4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+56 KB
...riementResults/BatchSize/Games256/Agent_Average_Score_Per_Move_Per_Game_BS8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| Experiment: Batch Size | ||
| -- 2, 4, 8, 16, 32 | ||
|
|
||
| DQN Layers | ||
| - input: 5 | ||
| - hidden1: 16 | ||
| - hidden2: 16 | ||
| - output: 5 | ||
|
|
||
| board size: 3x3 | ||
| num cans: 9 (full board) | ||
|
|
||
| num games: 256 / 512 / 768/ 1024 | ||
|
|
||
| epsilon_dec = 0.9 / (0.8 * num_games) | ||
| -- dec for 80% games, then 0.1 | ||
|
|
||
| learning rate = 0.003 | ||
|
|
||
| rewards | ||
| - pickup | ||
| - can: 10000 | ||
| - no can: -10 | ||
| - move | ||
| - wall: -50 | ||
| - empty: -5 |
Binary file added
BIN
+45.7 KB
...Board/EpsilonDecrease/Agent_Average_Score_Per_Move_Per_Game_BS8_g512_edec04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+51.8 KB
...Board/EpsilonDecrease/Agent_Average_Score_Per_Move_Per_Game_BS8_g512_edec06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+54.2 KB
...Board/EpsilonDecrease/Agent_Average_Score_Per_Move_Per_Game_BS8_g512_edec08.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+49.6 KB
...oard/EpsilonDecrease/Agent_Average_Score_Per_Move_Per_Game_BS8_g512_edec099.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+52.4 KB
...dFullOfcans/3x3 Board/EpsilonDecrease/Agents_Moves_Per_Game_BS8_g512_edec04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+45 KB
...dFullOfcans/3x3 Board/EpsilonDecrease/Agents_Moves_Per_Game_BS8_g512_edec06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42.2 KB
...dFullOfcans/3x3 Board/EpsilonDecrease/Agents_Moves_Per_Game_BS8_g512_edec08.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42.3 KB
...FullOfcans/3x3 Board/EpsilonDecrease/Agents_Moves_Per_Game_BS8_g512_edec099.png
Oops, something went wrong.
Binary file added
BIN
+61.6 KB
...dFullOfcans/3x3 Board/EpsilonDecrease/Agents_Score_Per_Game_BS8_g512_edec04.png
Oops, something went wrong.
Binary file added
BIN
+53.4 KB
...dFullOfcans/3x3 Board/EpsilonDecrease/Agents_Score_Per_Game_BS8_g512_edec06.png
Oops, something went wrong.
Binary file added
BIN
+51.7 KB
...dFullOfcans/3x3 Board/EpsilonDecrease/Agents_Score_Per_Game_BS8_g512_edec08.png
Oops, something went wrong.
Binary file added
BIN
+51.4 KB
...FullOfcans/3x3 Board/EpsilonDecrease/Agents_Score_Per_Game_BS8_g512_edec099.png
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
ExperiementResults/BoardFullOfcans/3x3 Board/EpsilonDecrease/Paramters.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| Experiment: EpsilonDecrease --> 0.9 / ( x * num_games ) | ||
| - x: 0.4, 0.6, 0.8, 0.99 | ||
|
|
||
| learning rate: 0.003 | ||
|
|
||
| DQN Layers | ||
| - input: 5 | ||
| - hidden1: 16 | ||
| - hidden2: 16 | ||
| - output: 5 | ||
|
|
||
| Board Size: 3x3 | ||
| Num cans: 9 (full board) | ||
|
|
||
| gamma = 0.99 | ||
|
|
||
| num games = 200 | ||
|
|
||
| epsilon_dec = 0.9 / (0.8 * num_games) | ||
| -- dec for 80% games, then 0.1 | ||
|
|
||
| batch size = 8 | ||
|
|
||
| rewards | ||
| - pickup | ||
| - can: 10000 | ||
| - no can: -10 | ||
| - move | ||
| - wall: -50 | ||
| - empty: -5 |
4 changes: 4 additions & 0 deletions
4
ExperiementResults/BoardFullOfcans/3x3 Board/EpsilonDecrease/Results.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| No useful results. | ||
| Model still plummets. | ||
|
|
||
| Sadly, this proves that once the model chooses actions deliberatly that it is highly frequently choosing moveing over picking up cans. |
Binary file added
BIN
+53.6 KB
...llOfcans/3x3 Board/LearningRate/Agent_Average_Score_Per_Move_Per_Game_LR001.png
Oops, something went wrong.
Binary file added
BIN
+55.3 KB
...llOfcans/3x3 Board/LearningRate/Agent_Average_Score_Per_Move_Per_Game_LR003.png
Oops, something went wrong.
Binary file added
BIN
+47 KB
...llOfcans/3x3 Board/LearningRate/Agent_Average_Score_Per_Move_Per_Game_LR005.png
Oops, something went wrong.
Binary file added
BIN
+44.2 KB
...ntResults/BoardFullOfcans/3x3 Board/LearningRate/Agents_Moves_Per_GameLR001.png
Oops, something went wrong.
Binary file added
BIN
+47.2 KB
...tResults/BoardFullOfcans/3x3 Board/LearningRate/Agents_Moves_Per_Game_LR003.png
Oops, something went wrong.
Binary file added
BIN
+44.1 KB
...tResults/BoardFullOfcans/3x3 Board/LearningRate/Agents_Moves_Per_Game_LR005.png
Oops, something went wrong.
Binary file added
BIN
+54.7 KB
...tResults/BoardFullOfcans/3x3 Board/LearningRate/Agents_Score_Per_Game_LR001.png
Oops, something went wrong.
Binary file added
BIN
+53.8 KB
...tResults/BoardFullOfcans/3x3 Board/LearningRate/Agents_Score_Per_Game_LR003.png
Oops, something went wrong.
Binary file added
BIN
+55.6 KB
...tResults/BoardFullOfcans/3x3 Board/LearningRate/Agents_Score_Per_Game_LR005.png
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
ExperiementResults/BoardFullOfcans/3x3 Board/LearningRate/Paramters.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| Experiment: Learning Rate | ||
| - 0.001, 0.003, 0.005 | ||
|
|
||
| DQN Layers | ||
| - input: 5 | ||
| - hidden1: 16 | ||
| - hidden2: 16 | ||
| - output: 5 | ||
|
|
||
| Board Size: 3x3 | ||
| Num cans: 9 (full board) | ||
|
|
||
| gamma = 0.99 | ||
|
|
||
| num games = 200 | ||
|
|
||
| epsilon_dec = 0.9 / (0.8 * num_games) | ||
| -- dec for 80% games, then 0.1 | ||
|
|
||
| batch size = 8 | ||
|
|
||
| rewards | ||
| - pickup | ||
| - can: 10000 | ||
| - no can: -10 | ||
| - move | ||
| - wall: -50 | ||
| - empty: -5 |
1 change: 1 addition & 0 deletions
1
ExperiementResults/BoardFullOfcans/3x3 Board/LearningRate/Results.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| varing the LR between 0.001, 0.003, and 0.005 did not seem to have a significant change in the model's behavior. |
Binary file added
BIN
+49 KB
...ullOfcans/4x4 board/HiddenNeurons/Agent_Average_Score_Per_Move_Per_Game_h16.png
Oops, something went wrong.
Binary file added
BIN
+48.6 KB
...FullOfcans/4x4 board/HiddenNeurons/Agent_Average_Score_Per_Move_Per_Game_h8.png
Oops, something went wrong.
Binary file added
BIN
+42.5 KB
...ntResults/BoardFullOfcans/4x4 board/HiddenNeurons/Agents_Moves_Per_Game_h16.png
Oops, something went wrong.
Binary file added
BIN
+39.8 KB
...entResults/BoardFullOfcans/4x4 board/HiddenNeurons/Agents_Moves_Per_Game_h8.png
Oops, something went wrong.
Binary file added
BIN
+43.5 KB
...ntResults/BoardFullOfcans/4x4 board/HiddenNeurons/Agents_Score_Per_Game_h16.png
Oops, something went wrong.
Binary file added
BIN
+42.7 KB
...entResults/BoardFullOfcans/4x4 board/HiddenNeurons/Agents_Score_Per_Game_h8.png
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
ExperiementResults/BoardFullOfcans/4x4 board/HiddenNeurons/Paramters.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| Experiment: Reward Structure | ||
|
|
||
| key: pick up can, puck up not can, move empty, move wall | ||
| 1) 10, -5, 0.1, -5 | ||
| 2) 10, -5, -0.1, -5 | ||
| 3) 10, -5, -1, -5 | ||
|
|
||
| learning rate: 0.003 | ||
|
|
||
| DQN Layers | ||
| - input: 5 | ||
| - hidden1: 16 | ||
| - hidden2: 16 | ||
| - output: 5 | ||
|
|
||
| Board Size: 4x4 | ||
| Num cans: 16 (full board) | ||
|
|
||
| gamma = 0.99 | ||
|
|
||
| num games = 768 | ||
|
|
||
| epsilon_dec = 0.9 / (0.8 * num_games) | ||
| -- dec for 80% games, then 0.1 | ||
|
|
||
| batch size = 8 |
Binary file added
BIN
+47.3 KB
.../BoardFullOfcans/4x4 board/Rewards/Agent_Average_Score_Per_Move_Per_Game_r1.png
Oops, something went wrong.
Binary file added
BIN
+47.9 KB
.../BoardFullOfcans/4x4 board/Rewards/Agent_Average_Score_Per_Move_Per_Game_r2.png
Oops, something went wrong.
Binary file added
BIN
+49 KB
.../BoardFullOfcans/4x4 board/Rewards/Agent_Average_Score_Per_Move_Per_Game_r3.png
Oops, something went wrong.
Binary file added
BIN
+42 KB
ExperiementResults/BoardFullOfcans/4x4 board/Rewards/Agents_Moves_Per_Game_r1.png
Oops, something went wrong.
Binary file added
BIN
+42.4 KB
ExperiementResults/BoardFullOfcans/4x4 board/Rewards/Agents_Moves_Per_Game_r2.png
Oops, something went wrong.
Binary file added
BIN
+42.5 KB
ExperiementResults/BoardFullOfcans/4x4 board/Rewards/Agents_Moves_Per_Game_r3.png
Oops, something went wrong.
Binary file added
BIN
+52.2 KB
ExperiementResults/BoardFullOfcans/4x4 board/Rewards/Agents_Score_Per_Game_r1.png
Oops, something went wrong.
Binary file added
BIN
+51.1 KB
ExperiementResults/BoardFullOfcans/4x4 board/Rewards/Agents_Score_Per_Game_r2.png
Oops, something went wrong.
Binary file added
BIN
+43.5 KB
ExperiementResults/BoardFullOfcans/4x4 board/Rewards/Agents_Score_Per_Game_r3.png
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
ExperiementResults/BoardFullOfcans/4x4 board/Rewards/Paramters.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| Experiment: Reward Structure | ||
|
|
||
| key: pick up can, puck up not can, move empty, move wall | ||
| 1) 10, -5, 0.1, -5 | ||
| 2) 10, -5, -0.1, -5 | ||
| 3) 10, -5, -1, -5 | ||
|
|
||
| learning rate: 0.003 | ||
|
|
||
| DQN Layers | ||
| - input: 5 | ||
| - hidden1: 16 | ||
| - hidden2: 16 | ||
| - output: 5 | ||
|
|
||
| Board Size: 4x4 | ||
| Num cans: 16 (full board) | ||
|
|
||
| gamma = 0.99 | ||
|
|
||
| num games = 768 | ||
|
|
||
| epsilon_dec = 0.9 / (0.8 * num_games) | ||
| -- dec for 80% games, then 0.1 | ||
|
|
||
| batch size = 8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import numpy as np | ||
| from matplotlib import pyplot as plt | ||
|
|
||
|
|
||
| def PlotScorePerGame(x_axis, scores, filename): | ||
| fig, ax = plt.subplots() | ||
| ax.plot(x_axis, scores) | ||
|
|
||
| ax.set(xlabel='Games', ylabel='Score', title='Agent\'s Score Per Game') | ||
| ax.grid() | ||
|
|
||
| fig.savefig(filename) | ||
| plt.show() | ||
|
|
||
| def PlotMovesPerGame(x_axis, moves, filename): | ||
| fig, ax = plt.subplots() | ||
| ax.plot(x_axis, moves) | ||
|
|
||
| ax.set(xlabel='Games', ylabel='Moves', title='Agent\'s Moves Per Game') | ||
| ax.grid() | ||
|
|
||
| fig.savefig(filename) | ||
| plt.show() | ||
|
|
||
| def PlotAverageScorePerMovePerGame(x_axis, avg_scores_per_move_per_game, filename): | ||
| fig, ax = plt.subplots() | ||
| ax.plot(x_axis, avg_scores_per_move_per_game) | ||
|
|
||
| ax.set(xlabel='Games', ylabel='Moves', title='Agent\'s Average Score Per Move Per Game') | ||
| ax.grid() | ||
|
|
||
| fig.savefig(filename) | ||
| plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
change number_of_actions to 5