summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2016-01-07 00:46:14 +0100
committerFlorian Jung <flo@windfisch.org>2016-01-07 00:46:14 +0100
commita230a461167bd03b296400ef90bdf0c5795f5fcc (patch)
treee8642fec96d367fea4abc84156fbd24848338b62
parenta7763a22a08117dca62a6e9616ecea33fe7e4c65 (diff)
fix bug
-rw-r--r--sol.py3
1 files changed, 1 insertions, 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.