-
Notifications
You must be signed in to change notification settings - Fork 39
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
Joint function for Evaluation and Jacobian ? #20
Comments
Hi, I am not sure I can do what you are asking for because it would impair the use of iterative methods (for example). However, I think you can minimize the wastes by using a struct which caches the jacobian and Fvalue and "your" functions would return those values to my package. |
I already thought about the caching option, wouldn't mind to do it this way. However I need to know when to "re-cache". Can I assume that for given x, both F and J are called exactly once, respectively ? Or are there cases when F is called and I would like to use two flags storing if F resp. J has been called, and I would re-cache and reset the flags on the next invocation. |
Pretty much I guess, everything is in |
Had a look into the code - in newtonPALC we also need to take into account the parameters. Just relying on the call pattern appears to be quite brittle... Thinking about storing hashes of x and p now . This should be O(N) and little work compared to the rest.
So this might do (Julia hash() would give a collision here). |
Le 29 juillet 2020 17:14:40 j-fu <[email protected]> a écrit :
Had a look into the code - in newtonPALC we also need to take into account
the parameters. Just relying on the call pattern appears to be quite
brittle... Thinking about storing hashes of x and p now .
you should think of x and p as a whole in this context. if i were to ask
for dpF would it simplify your work ( i would remove the FD approx in
newtonPALC)?
This should be O(N) and little work compared to the rest.
julia> myhash(X)=sum((x)->hash(x),X)
myhash (generic function with 1 method)
julia> Y=collect(1:0.0001:100);
julia> @time myhash(Y)
0.037302 seconds (119.07 k allocations: 5.307 MiB)
0xe408239bb83608ce
julia> @time myhash(Y)
0.004938 seconds (1 allocation: 16 bytes)
0xe408239bb83608ce
julia> Y[1000]+=1.0e-8
1.09990001
julia> @time myhash(Y)
0.003233 seconds (1 allocation: 16 bytes)
0xb9204860d37e4879
julia>
So this might do (Julia hash() would give a collision here).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Envoyé avec AquaMail pour Android
https://www.mobisystems.com/aqua-mail
|
I was thinking to ask about this. From a robustness POV, asking for dpF IMHO would be a better choice. I have plans to add the dpF creation resulting in a vector via autodiff. BTW currently I am just investigating these things for setting up my mind, I hope to find time to work on it in September. |
Me too, I cannot do it right now. BTW, did you try my package in conjonction with yours? |
Not yet - with this discussion I tried to clarify what I need to do, now it is pretty clear. I plan this for September... |
Hi, I am thinking about using your package. My first try would be to join this with my package VoronoiFVM.jl.
I understand that for the problem call back one can either pass F(x,p) or F(x,p) and J(x,p) together.
As in my code I am calculating F and (sparse) J at the same time using ForwardDiff and DiffResults I wonder if it
would be possible to have another option which allows to pass something like F_and_J(x,p) ?
The text was updated successfully, but these errors were encountered: