-
Notifications
You must be signed in to change notification settings - Fork 141
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
Add Nonparametric PDA and gate out non valid measurements #636
Conversation
Codecov Report
@@ Coverage Diff @@
## main #636 +/- ##
==========================================
+ Coverage 94.48% 94.50% +0.02%
==========================================
Files 171 171
Lines 8789 8822 +33
Branches 1705 1711 +6
==========================================
+ Hits 8304 8337 +33
Misses 350 350
Partials 135 135
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
fe653d5
to
a372be8
Compare
@@ -118,6 +137,7 @@ def hypothesise(self, track, detections, timestamp, **kwargs): | |||
|
|||
# True detection hypotheses | |||
for detection in detections: | |||
valid_measurement = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move this above line 154 with a comment about gating?
|
||
@staticmethod | ||
@lru_cache() | ||
def _inv_cov(meas_pred): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not too keen on single-line functions, but I'm guessing this is done to take advantage of caching?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. However, there are other modifications with Mahalanobis measure that include built in caching. I may rebase of main and then can take advantage of that and remove the need for this function.
if self.clutter_spatial_density is None: | ||
# Note: will divide by validated measurements count later... | ||
probability *= self._validation_region_volume( | ||
self.prob_gate, measurement_prediction) | ||
else: | ||
probability /= self.clutter_spatial_density |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if self.clutter_spatial_density is None: | |
# Note: will divide by validated measurements count later... | |
probability *= self._validation_region_volume( | |
self.prob_gate, measurement_prediction) | |
else: | |
probability /= self.clutter_spatial_density | |
# Parametric PDA | |
if self.clutter_spatial_density is not None: | |
probability /= self.clutter_spatial_density |
Might be more readable if the calculation for the case self.clutter_spatial_density is None
is all done in one place on lines 175-177, given that we are iterating over the hypotheses and making the check anyway. The comment is helpful, but I think keeping the "equations" together is more helpful.
Looks good overall 👍 Added some minor notes on making the code more readable. Note on earlier discussion: I don't think we can avoid gating when doing the non-parametric version. We could avoid it for the parametric one, but then it would be confusing to say we do gating in one case but not the other. |
This adds the ability to use nonparametric PDA for clutter spatial density, where it is estimated based on assumption that measurements within a defined validation region represent the clutter level. This change also gates out non valid measurements by default, similar to the behaviour in the DistanceHypothesier, and per description in original PDA paper.
a372be8
to
323f87a
Compare
This adds the ability to use nonparametric PDA for clutter spatial density, where it is estimated based on assumption that measurements within a defined validation region represent the clutter level.
This change also gates out non valid measurements by default, similar to the behaviour in the
DistanceHypothesier
, and per description in original PDA paper.