diff --git a/caliGraph.py b/caliGraph.py index ebef49b..dc4b5a7 100755 --- a/caliGraph.py +++ b/caliGraph.py @@ -831,8 +831,8 @@ def train(gamma = 1, full=True): books = loadBooksFromDB() bestWeights = copy.copy(weights) mse, gradient = evaluateFitness(books) + delta = sum(gradient[g]**2 for g in gradient) best_mse = mse - delta = 1 stagLen = 0 while gamma > 1.0e-06 and delta > 1.0e-06: @@ -854,6 +854,7 @@ def train(gamma = 1, full=True): if stagLen == 3 or mse > 100: for wt in weights: weights[wt] = random.random() + print('Done.') def saveWeights(weights): with open('neuralWeights.json', 'w') as f: