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

Allow custom gradient and Hessian in OptimizationFunction #97

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

sebapersson
Copy link
Contributor

See #96

For the uni- and bivariate case I have updated construct_fixed_optimisation_function to handle a custom gradient and Hessian. I have also added a test (Custom_hessian.jl) where results are compared for the Rosenbrock model with and without a custom gradient and Hessian.

I do not know if this passes all the tests, as when I run the tests locally the tests are killed after some time due to excessive RAM consumption.

Copy link

codecov bot commented Jan 20, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (2268df9) 90.41% compared to head (6501492) 91.28%.

Files Patch % Lines
src/problem_updates.jl 96.77% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #97      +/-   ##
==========================================
+ Coverage   90.41%   91.28%   +0.87%     
==========================================
  Files          16       16              
  Lines        1575     1629      +54     
==========================================
+ Hits         1424     1487      +63     
+ Misses        151      142       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sebapersson
Copy link
Contributor Author

Due to new syntax for remaking I should also have updated the test for shift, hopefully all tests should now pass.

@DanielVandH
Copy link
Owner

Thanks for this. I'll take another close look tomorrow just to be sure, but looks good!

Copy link
Owner

@DanielVandH DanielVandH left a comment

Choose a reason for hiding this comment

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

Just a couple of comments. Thanks so much again. If you don't have the time to add the tests I've mentioned, we can just leave it for now - the code all looks good to me.

src/problem_updates.jl Show resolved Hide resolved
test/Custom_hessian.jl Outdated Show resolved Hide resolved
test/runtests.jl Outdated Show resolved Hide resolved
@DanielVandH DanielVandH merged commit d2b7bd1 into DanielVandH:main Jan 23, 2024
4 checks passed
@DanielVandH
Copy link
Owner

Awesome job, thanks!

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.

None yet

2 participants