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 local tracers #65

Merged
merged 47 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
957d997
Add operators
adrhill May 15, 2024
194adab
Rename tracers
adrhill May 15, 2024
dad5e94
Add `Dual` and accessor functions
adrhill May 15, 2024
c29e035
Fix ops
adrhill May 15, 2024
15a2ccf
Update ops
adrhill May 15, 2024
5205fb3
Please the code coverage docs
adrhill May 15, 2024
1124a84
Fix typos
adrhill May 15, 2024
a4db872
Monkey-patch operator classific. on `min`/`max`
adrhill May 15, 2024
ce5c172
Refactor `GradientTracer` overload
adrhill May 15, 2024
6cb875b
First draft of Dual `GradientTracer`
adrhill May 15, 2024
b1610ca
add draft for local `HessianTracer`
adrhill May 15, 2024
2a0e77d
Add Hessian overloads on functions 1-to-2
adrhill May 15, 2024
2c19273
Update pattern
adrhill May 15, 2024
cd5c3ab
Get local `GradientTracer` to work
adrhill May 15, 2024
6c462ae
Remove overload on `rem`
adrhill May 16, 2024
2f12b8f
Help Julia specialize
adrhill May 16, 2024
c3a14aa
Refactor `GradientTracer` overloads
adrhill May 16, 2024
5fc8218
Add local first order tests
adrhill May 16, 2024
a9cffc8
Minor fixes
adrhill May 16, 2024
efcd18e
Test on `logdet` (#68)
adrhill May 16, 2024
d9566bb
Overload comparisons
adrhill May 16, 2024
86c6a44
Remove constant functions from `operators.jl`
adrhill May 16, 2024
424f5a0
Start adding conversions on duals
adrhill May 16, 2024
40b27d1
Support Dual `GradientTracer` on `^` and `rand`
adrhill May 16, 2024
770a129
First draft of `similar` on Duals
adrhill May 16, 2024
951b157
Remove `@eval` from `conversion.jl`
adrhill May 16, 2024
3426f9c
Fixes
adrhill May 16, 2024
24004c2
Add `local_*_pattern` functions
adrhill May 16, 2024
8459bad
Support duals on `ConnectivityTracer`
adrhill May 16, 2024
8398211
Refactor `HessianTracer` overloads
adrhill May 16, 2024
52cf2e5
Minor changes to `GradientTracer` overloads
adrhill May 16, 2024
103cf56
Fixes
adrhill May 16, 2024
9f0b516
omg
adrhill May 16, 2024
f72d310
omgv2
adrhill May 16, 2024
e92dcd4
Fix docstring test
adrhill May 16, 2024
7ce3d80
More tests
adrhill May 16, 2024
68a2310
Update tests
adrhill May 16, 2024
d7b9402
Fixes
adrhill May 16, 2024
c5edf82
Remove `2_to_1_one_tracer` functions
adrhill May 16, 2024
01b6435
Remove random number TODO
adrhill May 16, 2024
609120e
Fix `hessian_tracer_1_to_1` according to review
adrhill May 16, 2024
f0217f4
Fix `similar`
adrhill May 17, 2024
db6929f
Update docs
adrhill May 17, 2024
3257e48
Add `local_connectivity_pattern`
adrhill May 17, 2024
82f0514
Fix similar v2
adrhill May 17, 2024
923c5f0
Fix docs
adrhill May 17, 2024
5c14422
Add `MissingPrimalError`
adrhill May 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Currently, three tracer types are provided:

```@docs
SparseConnectivityTracer.ConnectivityTracer
SparseConnectivityTracer.GlobalGradientTracer
SparseConnectivityTracer.GlobalHessianTracer
SparseConnectivityTracer.GradientTracer
SparseConnectivityTracer.HessianTracer
```

We also define alternative pseudo-set types that can deliver faster `union`:
Expand Down
4 changes: 2 additions & 2 deletions src/SparseConnectivityTracer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ include("pattern.jl")
include("adtypes.jl")

export connectivity_pattern
export jacobian_pattern
export hessian_pattern
export jacobian_pattern, local_jacobian_pattern
export hessian_pattern, local_hessian_pattern

# ADTypes interface
export TracerSparsityDetector
Expand Down
12 changes: 5 additions & 7 deletions src/conversion.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Type conversions
for TT in (:GlobalGradientTracer, :ConnectivityTracer, :GlobalHessianTracer)
for TT in (:GradientTracer, :ConnectivityTracer, :HessianTracer)
@eval Base.promote_rule(::Type{T}, ::Type{N}) where {T<:$TT,N<:Number} = T
@eval Base.promote_rule(::Type{N}, ::Type{T}) where {T<:$TT,N<:Number} = T

Expand Down Expand Up @@ -29,11 +29,9 @@ end
function Base.similar(::Array, ::Type{ConnectivityTracer{C}}, dims::Dims{N}) where {C,N}
return zeros(ConnectivityTracer{C}, dims)
end
function Base.similar(::Array, ::Type{GlobalGradientTracer{G}}, dims::Dims{N}) where {G,N}
return zeros(GlobalGradientTracer{G}, dims)
function Base.similar(::Array, ::Type{GradientTracer{G}}, dims::Dims{N}) where {G,N}
return zeros(GradientTracer{G}, dims)
end
function Base.similar(
::Array, ::Type{GlobalHessianTracer{G,H}}, dims::Dims{N}
) where {G,H,N}
return zeros(GlobalHessianTracer{G,H}, dims)
function Base.similar(::Array, ::Type{HessianTracer{G,H}}, dims::Dims{N}) where {G,H,N}
return zeros(HessianTracer{G,H}, dims)
end
Loading
Loading