diff --git a/dICP/ICP.py b/dICP/ICP.py index 8354dff..b591649 100644 --- a/dICP/ICP.py +++ b/dICP/ICP.py @@ -177,7 +177,7 @@ def dICP(self, source, target, T_init, weight=None, trim_dist=None, loss_fn=None # Compute weighted Jacobian and error, this avoids having to form a weight matrix # which can be memory expensive # We add and subtract 1e-5 to avoid sqrt(0) nan gradients - w_sqrt = torch.sqrt(w) + w_sqrt = torch.sqrt(w + 1.0e-10) - 1.0e-5 err_w = w_sqrt.unsqueeze(-1) * err J_w = w_sqrt.unsqueeze(-1) * J