Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there sometime that sigmaloss may be inf? #97

Open
BIG-PIE-MILK-COW opened this issue Jul 24, 2023 · 1 comment
Open

Is there sometime that sigmaloss may be inf? #97

BIG-PIE-MILK-COW opened this issue Jul 24, 2023 · 1 comment

Comments

@BIG-PIE-MILK-COW
Copy link

As defined in SigmaLoss, sigmaloss = -torch.log(weights) * torch.exp(-(z_vals - depths[:, None]) ** 2 / (2 * 1)) * dists, and weights = alpha * torch.cumprod(torch.cat([torch.ones((alpha.shape[0], 1)).to(alpha.device), 1. - alpha + 1e-10], -1),-1)[:, :-1], raw2alpha = lambda raw, dists, act_fn=F.relu: 1. - torch.exp(-act_fn(raw) * dists) , as sometime raw could be negative,act_fn(raw) will be 0, then raw will be 0, weights will also be 0, then log(weights) will be inf, so the sigmaloss will be inf. Then in backward, there should be some errors. Have you encountered such a situation?

@dunbar12138
Copy link
Owner

Hi, thanks for your interest. We add a small amount to weights if encountering this issue.
Related issue: #69 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants