Fix curiosity tanh bug
This commit is contained in:
parent
73c7e5e6c2
commit
2f2da60626
@ -395,13 +395,15 @@ def removeUselessTags(G, minUnread=1):
|
|||||||
G.remove_node(n)
|
G.remove_node(n)
|
||||||
|
|
||||||
|
|
||||||
def curiosityReward(G, coeff=1, dTan=True):
|
def curiosityReward(G, coeff=1, dTan=False):
|
||||||
for n in list(G.nodes):
|
for n in list(G.nodes):
|
||||||
node = G.nodes[n]
|
node = G.nodes[n]
|
||||||
if 'score' in node and 'se' in node:
|
if 'score' in node and 'se' in node:
|
||||||
delta = node['se'] * coeff
|
delta = node['se'] * coeff
|
||||||
if dTan:
|
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))
|
new = max(0.0, min(10.0, node['score'] + delta))
|
||||||
node['score'] = new
|
node['score'] = new
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user