diff options
author | Florian Jung <flo@windfisch.org> | 2016-01-07 00:46:14 +0100 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2016-01-07 00:46:14 +0100 |
commit | a230a461167bd03b296400ef90bdf0c5795f5fcc (patch) | |
tree | e8642fec96d367fea4abc84156fbd24848338b62 | |
parent | a7763a22a08117dca62a6e9616ecea33fe7e4c65 (diff) |
fix bug
-rw-r--r-- | sol.py | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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. |