-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fix opachord.py to avoid nan in the gradient of ArtTransPure model #464
Fix opachord.py to avoid nan in the gradient of ArtTransPure model #464
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test file shown in #463?
maybe in integration/unittest_long/transmission/
I added |
tests/integration/unittests_long/transmission/transmission_grad_test.py
Outdated
Show resolved
Hide resolved
The newly added file is not pytest file. maybe remove |
I modified the filename and Nx. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
This pull request resolves the issue (#463) of NaN values in the gradient of the
ArtTransPure
transmission spectra model with respect to temperature, gravity_btm, radius_btm, and mean molecular weight. The NaN values originated from thejnp.sqrt
function inexojax/spec/opachord.py
.To address this, I implemented
jnp.tril
before thejnp.sqrt
operation. This modification zeros out irrelevant values, ensuring proper gradient calculations. Setting k=-1 injnp.tril
also zeroes the diagonal.Fixes #463