From a230a461167bd03b296400ef90bdf0c5795f5fcc Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Thu, 7 Jan 2016 00:46:14 +0100 Subject: fix bug --- sol.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sol.py b/sol.py index d0faf70..b37eb94 100644 --- a/sol.py +++ b/sol.py @@ -276,7 +276,6 @@ class QNN (QCommon): self.NN = libfann.neural_net() self.NN.create_sparse_array(connection_rate, (num_input,)+hidden+(num_output,)) self.NN.set_learning_rate(learning_rate) - #self.NN.set_activation_function_input(libfann.SIGMOID_SYMMETRIC_STEPWISE) self.NN.set_activation_function_hidden(libfann.SIGMOID_SYMMETRIC_STEPWISE) self.NN.set_activation_function_output(libfann.SIGMOID_SYMMETRIC_STEPWISE) #self.NN.set_activation_function_output(libfann.LINEAR) @@ -297,7 +296,7 @@ class QNN (QCommon): # this does not necessarily mean that the action is instantly trained into the function # representation. It may be held back in a list, to be batch-trained lated. def learn(self, oldstate, action, newstate, reward): - diff = self.value_update(oldstate,action,newstate,reward) + diff,_ = self.value_update(oldstate,action,newstate,reward) Q.change(oldstate,action,diff) # must be called on every end-of-episode. might trigger batch-training or whatever. -- cgit v1.2.3