Aggregated metrics not computed correctly
🐛 Bug
Aggregated values (mean, median) are not displayed correctly.
To reproduce
Log several values for different contexts, where some values appear multiple times as below:
import aim
run = aim.Run(experiment="test")
for step in range(3):
run.track(0, name="test", step=step, context=dict(context=0))
run.track(0, name="test", step=step, context=dict(context=1))
run.track(1, name="test", step=step, context=dict(context=2))
run.close()
In the UI, both median and mean are incorrectly shown as 0.5.
Expected behavior
In the example above, the mean per step is 0.33 and the median is 0.
Environment
- Aim v3.25.0 on Linux
Additional context
The issue appears to be that only unique values in the group are used to compute the mean/median. The issue doesn't appear with distinct values (e.g. 0, 0.2, 1).
Hey @kirschnj! Thanks a lot for noticing this. 🙌 I'll open the PR with a fix shortly.
Hey @kirschnj! The fix for this has been shipped with the latest release of aim: version 3.27.0.
Let me know if everything works properly.