MCPcopy Create free account
hub / github.com/NVlabs/InstantSplat / invert_cdf

Function invert_cdf

utils/stepfun.py:154–161  ·  view source on GitHub ↗

Invert the CDF defined by (t, w) at the points specified by u in [0, 1).

(u, t, w_logits)

Source from the content-addressed store, hash-verified

152
153
154def invert_cdf(u, t, w_logits):
155 """Invert the CDF defined by (t, w) at the points specified by u in [0, 1)."""
156 # Compute the PDF and CDF for each weight vector.
157 w = torch.softmax(w_logits, dim=-1)
158 cw = integrate_weights(w)
159 # Interpolate into the inverse CDF.
160 t_new = math.sorted_interp(u, cw, t)
161 return t_new
162
163
164def invert_cdf_np(u, t, w_logits):

Callers 1

sampleFunction · 0.85

Calls 1

integrate_weightsFunction · 0.85

Tested by

no test coverage detected