-
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
Add the GTPSA.jl backend #329
base: main
Are you sure you want to change the base?
Conversation
@mattsignorelli thank you for the contribution! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #329 +/- ##
===========================================
- Coverage 98.51% 54.75% -43.76%
===========================================
Files 108 103 -5
Lines 4297 4597 +300
===========================================
- Hits 4233 2517 -1716
- Misses 64 2080 +2016
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…nterface.jl into pr/mattsignorelli/329
Sorry for the delay on this, I've had my hands tied with all different projects. Two weeks ago I pushed major updates/fixes and finishing touches to |
The structure of the tests has changed a little since the last time you checked, can you merge |
Let me just take the time to review here, I haven't yet looked at your code. If all is well on the DI front, we can add |
@mattsignorelli before I review, I updated the tests so that we now have full code coverage information. Can you take a look and see if you are able to increase the coverage? One thing you need to know is that in-place operators like Another thing you may want to exploit to reduce code duplication is the redundancy between operators: |
Thanks for looking this over! For second order, because GTPSA does not allow nesting, separate operators must be written. For the first order operators I have also removed inaccessible branches (where The rest of the uncovered code is because the user can optionally specify a custom |
Sorry for taking so long to get back to you @mattsignorelli! I have brought your PR up to speed with the rest of the package, and taken into account the new version of ADTypes which includes function initialize!(xt::TPS, x::Number, dx::Number)
xt[0] = x
xt[1] = dx
return xt
end
function initialize!(xt::AbstractArray{<:TPS}, x::AbstractArray, dx::AbstractArray)
for i in eachindex(xt, x, dx)
initialize!(xt[i], x[i], dx[i])
end
return xt
end Can you maybe create similar functions to shorten the other operators? Just like |
Thanks for your work on this!
I think we need to be careful here. This would only apply for single-variable functions: julia> d = Descriptor(2,1); # two variables to first order
julia> f = TPS(use=d);
julia> f[0] = 1; f[1] = 2; f[2] = 3;
julia> print(f) # corresponds to f(dx1,dx2) = 1 + dx1 + dx2
TPS64:
Coefficient Order Exponent
1.0000000000000000e+00 0 0 0
2.0000000000000000e+00 1 1 0
3.0000000000000000e+00 1 0 1 Also, because the |
I think I understand what |
The expression "multiple seeds" is a bit unclear. For instance, for a function |
That's the setting considered in DI. Even with all the latest changes, there will only ever be one active variable |
Ah ok, I think I understand better. I'm admittedly not super familiar with the usual conventions used by most AD packages in Julia, only that in GTPSA, so I'm trying to connect the dots here. Let me explain how it works in GTPSA, and then maybe you can help better see how to fit it into DI: Basically with GTPSA, it calculates truncated power series in the variables, assuming the variables are small. So for example to calculate a Jacobian of a function Alternatively, one could do this one with variable, e.g. calculate |
That makes sense, thank you. But then I think the |
#316