diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2016-04-01 21:37:14 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2016-04-01 21:37:14 +0200 |
| commit | 9ebd00b02f8ba89191ed6c7a32d59dcb2062de5f (patch) | |
| tree | 26d3414f6013e7ea44f405aff302f073ad9a3dbf | |
| parent | 117b39ffe1a642fa418ac0490717fd1fdfcbdb78 (diff) | |
| download | boston-neuralnet-9ebd00b02f8ba89191ed6c7a32d59dcb2062de5f.tar.gz boston-neuralnet-9ebd00b02f8ba89191ed6c7a32d59dcb2062de5f.zip | |
more data
| -rw-r--r-- | neuralnet.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/neuralnet.py b/neuralnet.py index 6434e8a..7956ea5 100644 --- a/neuralnet.py +++ b/neuralnet.py @@ -99,14 +99,16 @@ with tf.device('/cpu:0'): # Alle Tensorflow-Variablen müssen bis hier spezifiziert sein! sess.run(tf.initialize_all_variables()) - jsonLog = dict() + jsonWeights = dict() + jsonError = dict() # Training for count in range(0, int(len(x_train) / BATCH)): - jsonLog[count] = dict() + jsonWeights[count] = dict() print("batch " + str(count)) for i in range(0, STEPS): result = sess.run([summaries, vecBias, matWeights, matWeightsHidden, + scalarError, train_step], feed_dict={ matInput: x_train[count*BATCH:(count+1)*BATCH], @@ -116,10 +118,15 @@ with tf.device('/cpu:0'): if not os.path.exists("inspect"): os.makedirs("inspect") - jsonLog[count][i] =\ + jsonWeights[count][i] =\ [[result[1].tolist()]] + [a.tolist() for a in result[2:4]] - f = open("inspect/log.json", "w+") - json.dump(jsonLog, f) + jsonError[count*BATCH+i] = str(result[4]) + f = open("inspect/weights.json", "w+") + json.dump(jsonWeights, f) + f.close() + print(jsonError) + f = open("inspect/error.json", "w+") + json.dump(jsonError, f) f.close() print("Training beendet") |
