-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in infractions/km calculation in compute_global_statistics #117
Comments
Precisely, the concept of a route is not part of the infractions / km metrics. No route concept is mentioned there. |
As a sidenote one needs to take additional care with the off-road infraction metric. The other option would be to change how off-road is reported and report every single instance where the agent drove off the road (and then just count as usual). |
Hey @Kait0, thanks for the detailed explanation. I'll take a look at it and report back |
With the coming release of the LB 2.0, this issue has been fixed. It is currently only available in the |
I think there is a bug in the computation of the infractions / km metrics in the current leaderboard repository (master):
The file is leaderboard/utils/statistics_manager.py
Function def compute_global_statistics(self, total_routes):
In the line:
global_record.infractions[key] += len(route_record.infractions[key]) / route_length_kms
The infractions/km from all the individual routes simply get added together, leading to nonsense value that are dependent on the number of routes.
The current code implements the following formula:
where c_i is the number of collisions in route, km_i is the number of km driven in route i. N is the number of routes.
A naive fix would be to divide by the number of routes:
However this is not exactly the correct calculation.
Slicing the driven km into route segments changes the result of the infraction / km metric and in the worst case can lead to a simpsons paradox.
What we want to compute is the total number of collisions / total number of km driven so the correct formula is:
which in code would looks something like adding the infractions (per type) as well as adding the driven (!) km to variables outside the for_loop and after the route for loop dividing the counts by the total number of driven kms.
The text was updated successfully, but these errors were encountered: