You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then, the actual harmonics functions involve a pow in (DT_COMPLEX64, DT_COMPLEX64) -> DT_COMPLEX64 signature, which probably utilizes polar form, hence undefined derivative in 0.
I also notice that in some cases tf.function seems to optimize it out and returns correct value of the derivative, but it's very unpredictable as to when this optimization takes place (e.g., it may happen in t.gradient, but not in t.jacobian).
A possible workaround would be to avoid casting to complex when self.use_phi is False.
The text was updated successfully, but these errors were encountered:
The problem occurs in the spherical harmonics calculation:
Output:
It happens due to casting to complex here:
m3gnet/m3gnet/utils/_math.py
Line 249 in 87173c1
Then, the actual harmonics functions involve a
pow
in(DT_COMPLEX64, DT_COMPLEX64) -> DT_COMPLEX64
signature, which probably utilizes polar form, hence undefined derivative in 0.I also notice that in some cases
tf.function
seems to optimize it out and returns correct value of the derivative, but it's very unpredictable as to when this optimization takes place (e.g., it may happen int.gradient
, but not int.jacobian
).A possible workaround would be to avoid casting to complex when
self.use_phi
isFalse
.The text was updated successfully, but these errors were encountered: