Turn a PDF that integrates to 1 into a vector of weights that sums to 1.
(t, p)
| 68 | |
| 69 | |
| 70 | def pdf_to_weight(t, p): |
| 71 | """Turn a PDF that integrates to 1 into a vector of weights that sums to 1.""" |
| 72 | return p * (t[..., 1:] - t[..., :-1]) |
| 73 | |
| 74 | |
| 75 | def max_dilate(t, w, dilation, domain=(-torch.inf, torch.inf)): |
no outgoing calls
no test coverage detected