deepmd.dpmodel.utils.safe_gradient#
Safe versions of some functions that have problematic gradients.
Check https://jax.readthedocs.io/en/latest/faq.html#gradients-contain-nan-where-using-where for more information.
Functions#
Safe version of sqrt that has a gradient of 0 at x = 0. | |
| Safe version of sqrt that has a gradient of 0 at x = 0. |