Skip to content
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

Including jvp for radius update schemes #172

Merged
merged 12 commits into from
Apr 3, 2023

Conversation

yash2798
Copy link
Member

No description provided.

src/jacobian.jl Outdated
@@ -144,3 +144,14 @@ function jacobian_autodiff(f, x::AbstractArray, nonlinfun, alg)
jac_prototype = jac_prototype, chunksize = chunk_size),
num_of_chunks)
end

function jvp(cache::TrustRegionCache{false})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put a ! on there because it's mutating.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are actually not modifying the cache, we are just returning the jvp. Should that still be done?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are modifying the cache in one of them



@unpack p1= cache
cache.trust_r = p1 * cache.internalnorm(jvp(cache)) # we need the gradient at the new (k+1)th point WILL THIS BECOME ALLOCATING?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment can be removed.

@ChrisRackauckas
Copy link
Member

Needs to add the dependency.

@codecov
Copy link

codecov bot commented Mar 25, 2023

Codecov Report

Merging #172 (50f266d) into master (c9ffc07) will increase coverage by 6.80%.
The diff coverage is 89.47%.

@@            Coverage Diff             @@
##           master     #172      +/-   ##
==========================================
+ Coverage   85.08%   91.88%   +6.80%     
==========================================
  Files           7        7              
  Lines         590      604      +14     
==========================================
+ Hits          502      555      +53     
+ Misses         88       49      -39     
Impacted Files Coverage Δ
src/jacobian.jl 87.17% <ø> (ø)
src/trustRegion.jl 94.81% <89.47%> (+16.02%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -61,6 +61,7 @@ SnoopPrecompile.@precompile_all_calls begin for T in (Float32, Float64)
end end

export RadiusUpdateSchemes
export auto_jacvec, auto_jacvec!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export auto_jacvec, auto_jacvec!

@@ -441,7 +445,7 @@ function dogleg!(cache::TrustRegionCache)

# Test if the full step is within the trust region.
if norm(u_tmp) ≤ trust_r
cache.step_size = u_tmp
cache.step_size = deepcopy(u_tmp)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be a .=?

@yash2798
Copy link
Member Author

yash2798 commented Apr 2, 2023

The issue is resolved, if there's nothing else, i think we can merge this pr.

@ChrisRackauckas
Copy link
Member

Test failed, looks like a tolerance issue.

@yash2798
Copy link
Member Author

yash2798 commented Apr 2, 2023

works now

@ChrisRackauckas ChrisRackauckas merged commit c698d16 into SciML:master Apr 3, 2023
@yash2798 yash2798 deleted the ys/tr_jvp branch April 7, 2023 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants