You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So this is not yet an issue of the current implementation, but I wanted to have a discussion on how to deal with this problem.
I attach an example, that needs to be run from the branch #1080 , where I create the global kalman filter proposal and I use it in a data association scenario.
The code falls apart when we have to compute the distances to perform the association and hypotheses generation because computing the mean is not possible due to "ZeroDivisionError: Weights sum to zero, can't be normalized" in State.
The code for mean in types/state is the following:
@clearable_cached_property('state_vector', 'log_weight')
def mean(self):
"""Sample mean for particles"""
if len(self) == 1: # No need to calculate mean
return self.state_vector
return np.average(self.state_vector, axis=1, weights=np.exp(self.log_weight))
Is weights=np.exp(self.log_weight)) safe enough? Or it should be better using logsumexp?
Or I am missing something more simpler.
Happy to discuss
The text was updated successfully, but these errors were encountered:
So this is not yet an issue of the current implementation, but I wanted to have a discussion on how to deal with this problem.
I attach an example, that needs to be run from the branch #1080 , where I create the global kalman filter proposal and I use it in a data association scenario.
The code falls apart when we have to compute the distances to perform the association and hypotheses generation because computing the mean is not possible due to "ZeroDivisionError: Weights sum to zero, can't be normalized" in State.
The code for mean in
types/state
is the following:Is
weights=np.exp(self.log_weight))
safe enough? Or it should be better usinglogsumexp
?Or I am missing something more simpler.
Happy to discuss
The text was updated successfully, but these errors were encountered: