From 212a30298ae200c774a1d7bc736100142070e900 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Fri, 24 Sep 2021 19:16:29 +0200 Subject: [PATCH] Stronger regression-loss; more parameter-freedome --- caliGraph.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/caliGraph.py b/caliGraph.py index 3d82115..894ae4f 100755 --- a/caliGraph.py +++ b/caliGraph.py @@ -705,7 +705,7 @@ def evaluateFitness(books): errSq[-1] *= 1.5 G.nodes[m]['rating'] = rating regressionLoss = sum([(1-w)**2 for w in weights.values()]) - return sum(errSq)/len(errSq) + regressionLoss/1000 + return sum(errSq)/len(errSq) + regressionLoss/100 def train(gamma = 0.1): global weights @@ -726,7 +726,7 @@ def train(gamma = 0.1): else: weights[attr] += delta if attr not in ['sigma', 'mu', 'se']: - weights[attr] = min(max(0.0, weights[attr]), 3.0) + weights[attr] = min(max(0.0, weights[attr]), 5.0) mse = evaluateFitness(books) if mse < best_mse: # got better saveWeights(weights)