From f0ebbd21a6ab27e4b97d03a19e06b01eb9a2114a Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Wed, 3 Feb 2016 18:09:19 +0100 Subject: proper frameskip for NN --- sol.py | 10 +++++++--- 1 file 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 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 -- cgit v1.2.3