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

Add HessianTracer #24

Merged
merged 10 commits into from
Apr 29, 2024
Merged

Add HessianTracer #24

merged 10 commits into from
Apr 29, 2024

Conversation

adrhill
Copy link
Owner

@adrhill adrhill commented Apr 29, 2024

Closes #20

CC: @gdalle @Vaibhavdixit02

Example

julia> using SparseConnectivityTracer

julia> x = rand(5);

julia> f(x) = x[1] + x[2]*x[3] + 1/x[4]
f (generic function with 1 method)

julia> H = pattern(f, HessianTracer, x)
5×5 SparseArrays.SparseMatrixCSC{Bool, UInt64} with 3 stored entries:
         
     1    
   1      
       1  
         

julia> g(x) = f(x) + x[2]^x[5]
g (generic function with 1 method)

julia> H = pattern(g, HessianTracer, x)
5×5 SparseArrays.SparseMatrixCSC{Bool, UInt64} with 7 stored entries:
         
   1  1    1
   1      
       1  
   1      1

@codecov-commenter
Copy link

codecov-commenter commented Apr 29, 2024

Codecov Report

Attention: Patch coverage is 49.64029% with 70 lines in your changes are missing coverage. Please review.

Project coverage is 54.91%. Comparing base (475e576) to head (cc9f808).

Files Patch % Lines
src/overload_hessian.jl 17.74% 51 Missing ⚠️
src/tracers.jl 69.23% 16 Missing ⚠️
src/conversion.jl 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #24      +/-   ##
==========================================
- Coverage   63.41%   54.91%   -8.50%     
==========================================
  Files           7        8       +1     
  Lines         123      244     +121     
==========================================
+ Hits           78      134      +56     
- Misses         45      110      +65     

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

@adrhill adrhill merged commit bbcefc5 into main Apr 29, 2024
3 checks passed
@adrhill adrhill deleted the ah/hessian branch April 29, 2024 19:46
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.

Add HessianTracer
2 participants