-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Just looked into the competence_dist function: https://github.com/flowersteam/explauto/blob/master/explauto/interest_model/competences.py#L4
def competence_dist(target, reached, dist_min=0., dist_max=1.):
return (min(- dist_min, - np.linalg.norm(target - reached))) / dist_maxI don't get this division by dist_max, what is it meant for? Also why is the division not casted in float?
It results in very weird behavior like:
competence_dist(0,0,2,10.0) -> -0.2 (expected -2 ?)
competence_dist(0,0,2,10) -> -1 (expected -2 ?)
competence_dist(0,100,0,1) -> -100 (expected -1 ?)
I would have assumed that we rather would like to bound the error between dist_min and dist_max, isn't it? But I might be missing something deeper here.
The patch would be:
def competence_dist(target, reached, dist_min=0., dist_max=1.):
return max((min(- dist_min, - np.linalg.norm(target - reached))), -dist_max)I also assume the move to negative domain is because competence should improve when error reduces.
Metadata
Metadata
Assignees
Labels
No labels