diff --git a/caliGraph.py b/caliGraph.py index bad53d4..03902c8 100755 --- a/caliGraph.py +++ b/caliGraph.py @@ -547,9 +547,9 @@ def addScoreToLabels(G): node['label'] += " ("+str(node['rating'])+")" else: if 'score' in node and node['score'] != None and 'se' in node: - node['label'] += " (~{:.2f}±{:.1f})".format(node['score'], node['se']) + node['label'] += " ({:.2f}±{:.1f})".format(node['score'], node['se']) else: - node['label'] += " (~0±∞)" + node['label'] += " (0±∞)" def genAndShowHTML(G, showButtons=False, darkMode=False, arrows=False): @@ -858,16 +858,18 @@ def train(initGamma = 1, full=True): else: stagLen = 0 if stagLen == 4 or mse > 50: - print("#") - stagLen = 0 - gamma = initGamma - if random.random() < 0.50: - for wt in weights: - weights[wt] = random.random() + if full or mse > 10: + stagLen = 0 + gamma = initGamma + if random.random() < 0.50: + for wt in weights: + weights[wt] = random.random() + else: + weights = copy.copy(bestWeights) + for wt in weights: + weights[wt] *= 0.975+0.05*random.random() else: - weights = copy.copy(bestWeights) - for wt in weights: - weights[wt] *= 0.975+0.05*random.random() + break print('Done.') def saveWeights(weights):