From 2f2da60626880194be9af45a75aea7006741875d Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Wed, 30 Nov 2022 17:44:12 +0100 Subject: [PATCH] Fix curiosity tanh bug --- caliGraph.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/caliGraph.py b/caliGraph.py index a39db06..e35c0a5 100755 --- a/caliGraph.py +++ b/caliGraph.py @@ -395,13 +395,15 @@ def removeUselessTags(G, minUnread=1): G.remove_node(n) -def curiosityReward(G, coeff=1, dTan=True): +def curiosityReward(G, coeff=1, dTan=False): for n in list(G.nodes): node = G.nodes[n] if 'score' in node and 'se' in node: delta = node['se'] * coeff if dTan: - delta *= (1- math.tanh((node['score']/10-0.5)*7)**2) + delta *= (1 - math.tanh((node['score']/10-0.5)*7)**2) + else: + delta *= (1 - math.tanh(node['score']/5)) new = max(0.0, min(10.0, node['score'] + delta)) node['score'] = new