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

numerically stable radius penalty #1063

Merged
merged 1 commit into from
Aug 10, 2023
Merged

Conversation

tylerflex
Copy link
Collaborator

@tylerflex tylerflex commented Aug 9, 2023

previously, I smoothed the radius of curvature calculation by adding 1e-2 to the denominator. This avoided it going to infinity for infinitely straight edges. However, when the actual radius of curvature was close to 1e-2 it gave inaccurate results. Instead, I made the penalty function a numerically stable version for x > 0, which solves the issue more generally.

old

penalty(x) = 1/(1 + exp(x))

new

penalty(x)= exp(-x)/(1 + exp(-x))

@tylerflex tylerflex marked this pull request as draft August 9, 2023 16:40
@tylerflex tylerflex changed the title relax radius penalty smoothing numerically stable radius penalty Aug 9, 2023
@tylerflex tylerflex marked this pull request as ready for review August 9, 2023 20:13
@tylerflex tylerflex force-pushed the tyler/fix/radius_penalty branch 2 times, most recently from 7a7741a to f92e4a2 Compare August 9, 2023 20:15
@tylerflex tylerflex added the 2.4 label Aug 10, 2023
@tylerflex tylerflex merged commit 36a1248 into pre/2.4 Aug 10, 2023
16 checks passed
@tylerflex tylerflex deleted the tyler/fix/radius_penalty branch August 10, 2023 19:23
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

Successfully merging this pull request may close these issues.

None yet

2 participants