Matching functions¶
Bernoulli¶
-
class
radbm.match.bernoulli.MultiBernoulliMembershipMatch(terms=None)¶ Functional to compute the probability that a Multi-Bernoulli is a member of a set of mutually independent Multi-Bernoulli.
\[A_1 - A_2 + A_3 - A_4 + \dots \pm A_l\]where
\[A_t = \sum_{i_1=t}^l \sum_{i_2=t-1}^{i_1} \sum_{i_3=t-2}^{i_2} \dots \sum_{i_t=1}^{i_{t-1}} P(M_{i_1},\; M_{i_2},\; \dots,\; M_{i_t})\]and \(M_i\) is the event that the Multi-Bernoulli is equal to the i-th Multi-Bernoulli of the set.
Parameters: terms (list of int or None (optinal)) – The terms to consider in the alternated sum. If None, all terms are considered (default: None) Notes
The computation if exponential w.r.t. the number of Multi-Bernoulli in the set. This is because the i-th term in the alterated sum costs \(\binom{l}{i}\) where l is the number of Multi-Bernoulli in the set.
-
soft_match(x, y)¶ Parameters: - x (torch.tensor (dtype: float)) – A batch of Multi-Bernolli’s logits (pre-sigmoid). x.shape = (…, number_of_bits).
- y (torch.tensor (dtype: float)) – A batch of l Multi-Bernoulli’s logits (pre-sigmoid). y.shape = (…, l, number_of_bits).
Returns: - log_probs_not_match (torch.tensor (dtype: float).) – log_probs_not_match[i] is the log probability that each of the l Multi-Bernoulli parametrized by y[i] is different than the Multi-Bernoulli parameterized x[i].
- log_probs_match (torch.tensor (dtype: float).) – log_probs_match[i] is the log probability that at least one of the l Multi-Bernoulli parametrized by y[i] is equal to the Multi-Bernoulli parameterized x[i].
Notes
x.shape[:-1] does not broadcast with y.shape[:-2].
Raises: ValueError– If x.ndim + 1 != y.ndim.ValueError– If x.shape[-1] != y.shape[-1] (i.e., different number of bits).ValueError– If no valid odd term (i.e., within 1 up to l) is given in terms.
-