summaryrefslogtreecommitdiff
path: root/sol.py
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2016-02-03 18:09:19 +0100
committerFlorian Jung <flo@windfisch.org>2016-02-03 18:09:19 +0100
commitf0ebbd21a6ab27e4b97d03a19e06b01eb9a2114a (patch)
tree977ab3908ee04781832fe751fd71cc7d5c302c15 /sol.py
parentd8b98f347d0858128074054dea583772692365d0 (diff)
proper frameskip for NN
Diffstat (limited to 'sol.py')
-rw-r--r--sol.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/sol.py b/sol.py
index ca163ce..c4d8458 100644
--- a/sol.py
+++ b/sol.py
@@ -21,7 +21,8 @@ alpha_reduction = 0.9998
friendlyness = 0.7 # probability that the model actually performs the action we've requested.
# the model will perform a random other actions with probability of (1-friendlyness)/3.
# putting 0.25 here will make it just random.
-frameskip = 99
+frameskip_array = 99
+frameskip_nn = 0
visu = True
@@ -72,7 +73,8 @@ if arg['-h']:
" nn -> neural network representation\n" +
" default: array" +
" --frameskip NUM # frameskip for visualisation\n" +
- " # default: %f\n" % frameskip +
+ " # default: %f for --qfunc array\n" % frameskip_array +
+ " # %f for --qfunc nn\n" % frameskip_nn +
" --sleep # sleep after every <frameskip> frames\n"+
" --quiet # disable visualisation\n" +
" --file FILE # output file for q learning")
@@ -87,7 +89,7 @@ if arg['--sleep']:
do_sleep = True
if arg['--frameskip']:
- frameskip = int(arg['--frameskip'])
+ frameskip_array=frameskip_nn = int(arg['--frameskip'])
if arg['--episodes']:
n_episodes = int(arg['--episodes'])
@@ -354,8 +356,10 @@ a = World(maze, start)
Q = None
if arg['--qfunc'] == "nn":
Q = QNN()
+ frameskip = frameskip_nn
else:
Q = QArray()
+ frameskip = frameskip_array
i=0
stopstate = -1