7970d5d122436c48dba4cead0d6dd20c241b5e28,jaxnerf/nerf/model_utils.py,,piecewise_constant_pdf,#Any#Any#Any#Any#Any#,221

Before Change


  cdf_g0, cdf_g1 = minmax(cdf)

  denom = (cdf_g1 - cdf_g0)
  denom = jnp.where(denom < eps, 1., denom)
  t = (u - cdf_g0) / denom
  z_samples = bins_g0 + t * (bins_g1 - bins_g0)

  // Prevent gradient from backprop-ing through samples

After Change


  // avoids NaNs when the input is zeros or small, but has no effect otherwise.
  eps = 1e-5
  weight_sum = jnp.sum(weights, axis=-1, keepdims=True)
  padding = jnp.maximum(0, eps - weight_sum)
  weights += padding / weights.shape[-1]
  weight_sum += padding

  // Compute the PDF and CDF for each weight vector.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: google-research/google-research
Commit Name: 7970d5d122436c48dba4cead0d6dd20c241b5e28
Time: 2021-01-05
Author: barron@google.com
File Name: jaxnerf/nerf/model_utils.py
Class Name:
Method Name: piecewise_constant_pdf


Project Name: matplotlib/matplotlib
Commit Name: dd1c386c8f5c2e223b27f16f67e1c603b83eb449
Time: 2018-10-06
Author: anntzer.lee@gmail.com
File Name: lib/matplotlib/projections/geo.py
Class Name: LambertTransform
Method Name: transform_non_affine


Project Name: matplotlib/matplotlib
Commit Name: dd1c386c8f5c2e223b27f16f67e1c603b83eb449
Time: 2018-10-06
Author: anntzer.lee@gmail.com
File Name: lib/matplotlib/projections/geo.py
Class Name: InvertedLambertTransform
Method Name: transform_non_affine