- 
                Notifications
    You must be signed in to change notification settings 
- Fork 41
Fix periodic kernel AD #531
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
Conversation
| Codecov ReportAttention:  
 
 Additional details and impacted files@@             Coverage Diff             @@
##           master     #531       +/-   ##
===========================================
- Coverage   90.34%   67.81%   -22.54%     
===========================================
  Files          52       52               
  Lines        1378     1454       +76     
===========================================
- Hits         1245      986      -259     
- Misses        133      468      +335     ☔ View full report in Codecov by Sentry. | 
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
| xi = view(x, i, :) | ||
| xj = view(x, j, :) | ||
| ds = twoπ .* Δ[i, j] .* sinpi.(xi .- xj) .* cospi.(xi .- xj) ./ d.r .^ 2 | ||
| r̄ .-= 2 .* Δ[i, j] .* sinpi.(xi .- xj) .^ 2 ./ d.r .^ 3 | 
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.
This assumes that rbar supports setindex! which is not true in general.
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.
I think in this case, it is because the field of Sinus is a Vector.
| Ok, I added ChainRulesTestUtils tests for normal and static arrays. The static case is certainly not optimal, but I don't have the capacity to think of how to rewrite the rules to be non-mutating. If anyone knows off-hand how to do this, feel free to make a suggestion. | 
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
b1a0b82    to
    92b4576      
    Compare
  
    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
| @willtebbutt Could we merge this? The comment regarding the generality of the rule does not I apply (I believe) because of the concrete type of the field of  | 
| I have no objection to merging. @devmotion do you have thoughts? | 
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.
A few additional suggestions.
Co-authored-by: David Widmann <[email protected]>
This PR reactivates the AD tests for the periodic kernel and introduces
rrulesto make them pass.Fixes #527