Skip to content

Commit 1d10d2d

Browse files
authored
Remove Optim.jl interface + minor tidying up of src/optimisation/Optimisation (#2708)
notes in comments. Further refactoring will happen, but in separate PRs. Closes #2635.
1 parent b59947a commit 1d10d2d

File tree

7 files changed

+70
-507
lines changed

7 files changed

+70
-507
lines changed

HISTORY.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ As long as the above functions are defined correctly, Turing will be able to use
1818

1919
The `Turing.Inference.isgibbscomponent(::MySampler)` interface function still exists, but in this version the default has been changed to `true`, so you should not need to overload this.
2020

21+
## Optimisation interface
22+
23+
The Optim.jl interface has been removed (so you cannot call `Optim.optimize` directly on Turing models).
24+
You can use the `maximum_likelihood` or `maximum_a_posteriori` functions with an Optim.jl solver instead (via Optimization.jl: see https://docs.sciml.ai/Optimization/stable/optimization_packages/optim/ for documentation of the available solvers).
25+
26+
## Internal changes
27+
28+
The constructors of `OptimLogDensity` have been replaced with a single constructor, `OptimLogDensity(::DynamicPPL.LogDensityFunction)`.
29+
2130
# 0.41.4
2231

2332
Fixed a bug where the `check_model=false` keyword argument would not be respected when sampling with multiple threads or cores.

Project.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,9 @@ StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
4141

4242
[weakdeps]
4343
DynamicHMC = "bbc10e6e-7c05-544b-b16e-64fede858acb"
44-
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
4544

4645
[extensions]
4746
TuringDynamicHMCExt = "DynamicHMC"
48-
TuringOptimExt = ["Optim", "AbstractPPL"]
4947

5048
[compat]
5149
ADTypes = "1.9"
@@ -72,7 +70,6 @@ LinearAlgebra = "1"
7270
LogDensityProblems = "2"
7371
MCMCChains = "5, 6, 7"
7472
NamedArrays = "0.9, 0.10"
75-
Optim = "1"
7673
Optimization = "3, 4, 5"
7774
OptimizationOptimJL = "0.1, 0.2, 0.3, 0.4"
7875
OrderedCollections = "1"
@@ -86,7 +83,3 @@ StatsAPI = "1.6"
8683
StatsBase = "0.32, 0.33, 0.34"
8784
StatsFuns = "0.8, 0.9, 1"
8885
julia = "1.10.8"
89-
90-
[extras]
91-
DynamicHMC = "bbc10e6e-7c05-544b-b16e-64fede858acb"
92-
Optim = "429524aa-4258-5aef-a3af-852621145aeb"

ext/TuringOptimExt.jl

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

0 commit comments

Comments
 (0)