dstl / Stone-Soup

A software project to provide the target tracking community with a framework for the development and testing of tracking algorithms.
https://stonesoup.rtfd.io
MIT License
400 stars 131 forks source link

Modify assign2D to exploit NumPy indexing #709

Closed sdhiscocks closed 1 year ago

sdhiscocks commented 1 year ago

Previously this used iteration rather than indexing. By changing to using indexing and vectorising some calculations, gives a performance benefit for large number of tracks/detections.

Performance difference isn't noticeable on a small cost matrix, but testing on a (1988, 4808) cost matrix results in identical output with ~50x to 60x speed up.

codecov[bot] commented 1 year ago

Codecov Report

Merging #709 (23cba43) into main (5276c1b) will decrease coverage by 0.03%. The diff coverage is 83.72%.

@@            Coverage Diff             @@
##             main     #709      +/-   ##
==========================================
- Coverage   94.62%   94.59%   -0.04%     
==========================================
  Files         172      172              
  Lines        8845     8802      -43     
  Branches     1714     1698      -16     
==========================================
- Hits         8370     8326      -44     
- Misses        343      344       +1     
  Partials      132      132              
Flag Coverage Δ
integration 70.21% <83.72%> (-0.17%) :arrow_down:
unittests 90.74% <83.72%> (-0.06%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
stonesoup/dataassociator/neighbour.py 94.04% <0.00%> (ø)
stonesoup/dataassociator/_assignment.py 84.05% <85.71%> (-7.02%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.