Conversation
…ration in `BackendTensor`
…in vertex computation - Updated `_gen_vertices.py` to use `torch.linalg.solve` instead of matrix inversion (`linalg.inv`) for solving ATA @ x = ATb. - Added regularization for enhanced stability.
- Added clamping to `_sigmoid` to address potential exponential overflow issues causing NaN gradients in float32 precision.
…rlaps - Detached and cloned mesh vertices to safeguard the autograd graph from in-place modifications during overlap vertex averaging. - Stored original differentiable vertices as `vertices_tensor`.
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
change_backend_gempy method to streamline backend configuration in BackendTensor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

[BUGFIX] Replace
invwithsolvefor improved numerical stability in vertex computation_gen_vertices.pyto usetorch.linalg.solveinstead of matrix inversion (linalg.inv) for solving ATA @ x = ATb.1e-4 * I) for enhanced numerical stability.[BUGFIX] Clamp sigmoid input to prevent overflow and NaN gradients
_sigmoidin_soft_segment.pyto prevent exponential overflow issues that cause NaN gradients in float32 precision.clamp) and NumPy (clip) backends.[BUGFIX] Prevent autograd graph corruption during overlap vertex averaging
vertices_tensoron each mesh before in-place overlap modifications.mesh.verticeswith a detached clone (PyTorch) or copy (NumPy) to prevent vertex averaging from corrupting the autograd graph of the original solve output.[ENH] Deduplicate
change_backend_gempydefinition inBackendTensorchange_backend_gempymethod introduced inbackend_tensor.py.