Skip to content

Commit e961ac2

Browse files
authored
remove AD code, update docs, bump to 2.0 (#99)
* remove AD code, update docs, bump to 2.0
1 parent d4f03be commit e961ac2

14 files changed

Lines changed: 20 additions & 545 deletions

Project.toml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,22 @@
11
name = "LogDensityProblems"
22
uuid = "6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c"
33
authors = ["Tamas K. Papp <tkpapp@gmail.com>"]
4-
version = "1.0.3"
4+
version = "2.0.0"
55

66
[deps]
77
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
88
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
99
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
10-
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
1110
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
1211

1312
[compat]
1413
ArgCheck = "1, 2"
15-
BenchmarkTools = "1"
1614
DocStringExtensions = "0.8, 0.9"
17-
Requires = "0.5, 1"
1815
UnPack = "0.1, 1"
1916
julia = "1.6"
2017

2118
[extras]
22-
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
23-
DiffResults = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"
24-
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
25-
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
26-
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
27-
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
28-
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
29-
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
30-
StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
3119
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
32-
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
33-
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
3420

3521
[targets]
36-
test = ["BenchmarkTools", "Distributions", "Documenter", "ForwardDiff", "Pkg", "ReverseDiff", "StatsBase", "StatsFuns", "Test", "Tracker", "Zygote"]
22+
test = ["Test"]

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ A common framework for implementing and using log densities for inference, provi
1111

1212
1. The [`logdensity`](https://tamaspapp.eu/LogDensityProblems.jl/dev/#LogDensityProblems.logdensity) method with corresponding interface, which can be used by other packages that operate on (log) densities and need to evaluate the log densities or the gradients (eg [MCMC](https://en.wikipedia.org/wiki/Markov_chain_Monte_Carlo), [MAP](https://en.wikipedia.org/wiki/Maximum_a_posteriori_estimation), [ML](https://en.wikipedia.org/wiki/Maximum_likelihood_estimation) or similar methods).
1313

14-
2. The [`ADgradient`](https://tamaspapp.eu/LogDensityProblems.jl/dev/#LogDensityProblems.ADgradient) which makes objects that support `logdensity` to calculate log density *values* calculate log density *gradients* using various automatic differentiation packages.
15-
16-
3. Various utility functions for debugging and testing log densities.
14+
2. Various utility functions for debugging and testing log densities.
1715

1816
**NOTE** As of version 1.0, transformed log densities have been moved to [TransformedLogDensities.jl](https://github.com/tpapp/TransformedLogDensities.jl). Existing code that uses `TransformedLogDensity` should add
1917
```
2018
using TransformedLogDensities
2119
```
2220
or equivalent.
2321

22+
**NOTE**: As of version 2.0, automatic differentiation backends have been moved to [https://github.com/tpapp/LogDensityProblemsAD.jl](https://github.com/tpapp/LogDensityProblemsAD.jl "LogDensityProblemsAD.jl"). If your code uses `ADgradient`, simply add
23+
```julia
24+
using LogDensityProblemsAD
25+
```
26+
or equivalent.
27+
2428
See the [documentation](https://tpapp.github.io/LogDensityProblems.jl/dev) for details.

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
33
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
44
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
5+
LogDensityProblemsAD = "996a588d-648d-4e1f-a8f0-a84b347e47b1"
56
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
67
TransformVariables = "84d833dd-6860-57f9-a1a7-6da5db126cff"
78
TransformedLogDensities = "f9bc47f6-f3f8-4f3b-ab21-f8bc73906f26"

docs/make.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Documenter, LogDensityProblems, ForwardDiff, Tracker, Zygote, BenchmarkTools, TransformedLogDensities
1+
using Documenter, LogDensityProblems, ForwardDiff, Tracker, Zygote, BenchmarkTools,
2+
TransformedLogDensities, LogDensityProblemsAD
23

34
makedocs(
45
sitename = "LogDensityProblems.jl",

docs/src/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,19 +131,20 @@ Here we use the exponential function to transform from ``\mathbb{R}`` to the pos
131131

132132
## Automatic differentiation
133133

134-
Using either definition, you can now transform to another object which is capable of evaluating the *gradient*, using automatic differentiation. The wrapper for this is
135-
```@docs
136-
ADgradient
137-
```
134+
Using either definition, you can transform to another object which is capable of evaluating the *gradient*, using automatic differentiation. For this, you need the [LogDensityProblemsAD.jl](https://github.com/tpapp/LogDensityProblemsAD.jl) package.
138135

139136
Now observe that we can obtain gradients, too:
140137
```@repl 1
141138
import ForwardDiff
139+
using LogDensityProblemsAD
142140
∇ℓ = ADgradient(:ForwardDiff, ℓ)
143141
LogDensityProblems.capabilities(∇ℓ)
144142
LogDensityProblems.logdensity_and_gradient(∇ℓ, zeros(2))
145143
```
146144

145+
!!! note
146+
Before version 2.0, `ADgradient` was part of this package. To update older code, just add `using LogDensityProblemsAD`.
147+
147148
## Manually calculated derivatives
148149

149150
If you prefer not to use automatic differentiation, you can wrap your own derivatives following the template
@@ -171,7 +172,6 @@ You may find these utilities useful for debugging and optimization.
171172

172173
```@docs
173174
LogDensityProblems.stresstest
174-
LogDensityProblems.benchmark_ForwardDiff_chunks
175175
```
176176

177177
# [Log densities API](@id log-density-api)

src/AD_Enzyme.jl

Lines changed: 0 additions & 61 deletions
This file was deleted.

src/AD_ForwardDiff.jl

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/AD_ReverseDiff.jl

Lines changed: 0 additions & 60 deletions
This file was deleted.

src/AD_Tracker.jl

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/AD_Zygote.jl

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)