Skip to content

Commit ba10394

Browse files
Red-Portalgithub-actions[bot]yebaipenelopeysm
authored
Update to the [email protected] interface (#2506)
* update to match the [email protected] interface * run formatter Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * run formatter Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * run formatter Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * run formatter Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * run formatter Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * run formatter Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * run formatter Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * run formatter Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * run formatter Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * remove plotting * fix formatting Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix formatting Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix formatting Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * remove unused dependency * Update Project.toml * fix make some arugments of vi initializer to be optional kwargs * remove tests for custom optimizers * remove unused file * Update src/variational/bijectors.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update Turing.jl * fix remove call to `AdvancedVI.turnprogress`, which has been removed * apply comments from @yebai * Update src/variational/VariationalInference.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * add old interface as deprecated * bump AdvancedVI version * add deprecation for `meanfield` * add `default_rng` interfaces * add tests for variational inference * run formatter Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * remove "src/variational/bijectors.jl" (moved to `DynamicPPL.jl`) * add more tests for variational inference initializer * remove non-essential reexports, fix tests * run formatter, rename functions * add documentation * fix run formatter * fix remove debug commits * run formatter Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * run formatter Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * run formatter Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * add Variational submodule * fix docstring style * update docstring style * format docstring style * fix typo Co-authored-by: Penelope Yong <[email protected]> * fix use fixed seed with StableRNGs * fix export variational families * fix forma Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * update changelog for advancedvi 0.4 * fix version number * Format & add some links * fix formatting Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Hong Ge <[email protected]> Co-authored-by: Penelope Yong <[email protected]>
1 parent 5601b2d commit ba10394

File tree

13 files changed

+519
-192
lines changed

13 files changed

+519
-192
lines changed

HISTORY.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Release 0.39.0
22

3+
## Update to the AdvancedVI interface
4+
5+
Turing's variational inference interface was updated to match version 0.4 version of AdvancedVI.jl.
6+
7+
AdvancedVI v0.4 introduces various new features:
8+
9+
- location-scale families with dense scale matrices,
10+
- parameter-free stochastic optimization algorithms like `DoG` and `DoWG`,
11+
- proximal operators for stable optimization,
12+
- the sticking-the-landing control variate for faster convergence, and
13+
- the score gradient estimator for non-differentiable targets.
14+
15+
Please see the [Turing API documentation](https://turinglang.org/Turing.jl/stable/api/#Variational-inference), and [AdvancedVI's documentation](https://turinglang.org/AdvancedVI.jl/stable/), for more details.
16+
317
## Removal of Turing.Essential
418

519
The Turing.Essential module has been removed.

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Accessors = "0.1"
5353
AdvancedHMC = "0.3.0, 0.4.0, 0.5.2, 0.6, 0.7"
5454
AdvancedMH = "0.8"
5555
AdvancedPS = "0.6.0"
56-
AdvancedVI = "0.2"
56+
AdvancedVI = "0.4"
5757
BangBang = "0.4.2"
5858
Bijectors = "0.14, 0.15"
5959
Compat = "4.15.0"

docs/make.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ makedocs(;
2323
pages=[
2424
"Home" => "index.md",
2525
"API" => "api.md",
26-
"Submodule APIs" =>
27-
["Inference" => "api/Inference.md", "Optimisation" => "api/Optimisation.md"],
26+
"Submodule APIs" => [
27+
"Inference" => "api/Inference.md",
28+
"Optimisation" => "api/Optimisation.md",
29+
"Variational " => "api/Variational.md",
30+
],
2831
],
2932
checkdocs=:exports,
3033
doctest=false,

docs/src/api.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,14 @@ even though [`Prior()`](@ref) is actually defined in the `Turing.Inference` modu
7777

7878
### Variational inference
7979

80-
See the [variational inference tutorial](https://turinglang.org/docs/tutorials/09-variational-inference/) for a walkthrough on how to use these.
81-
82-
| Exported symbol | Documentation | Description |
83-
|:--------------- |:---------------------------- |:--------------------------------------- |
84-
| `vi` | [`AdvancedVI.vi`](@extref) | Perform variational inference |
85-
| `ADVI` | [`AdvancedVI.ADVI`](@extref) | Construct an instance of a VI algorithm |
80+
See the [docs of AdvancedVI.jl](https://turinglang.org/AdvancedVI.jl/stable/) for detailed usage and the [variational inference tutorial](https://turinglang.org/docs/tutorials/09-variational-inference/) for a basic walkthrough.
81+
82+
| Exported symbol | Documentation | Description |
83+
|:---------------------- |:------------------------------------------------- |:---------------------------------------------------------------------------------------- |
84+
| `vi` | [`Turing.vi`](@ref) | Perform variational inference |
85+
| `q_locationscale` | [`Turing.Variational.q_locationscale`](@ref) | Find a numerically non-degenerate initialization for a location-scale variational family |
86+
| `q_meanfield_gaussian` | [`Turing.Variational.q_meanfield_gaussian`](@ref) | Find a numerically non-degenerate initialization for a mean-field Gaussian family |
87+
| `q_fullrank_gaussian` | [`Turing.Variational.q_fullrank_gaussian`](@ref) | Find a numerically non-degenerate initialization for a full-rank Gaussian family |
8688

8789
### Automatic differentiation types
8890

docs/src/api/Variational.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# API: `Turing.Variational`
2+
3+
```@autodocs
4+
Modules = [Turing.Variational]
5+
Order = [:type, :function]
6+
```

src/Turing.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ function setprogress!(progress::Bool)
3939
@info "[Turing]: progress logging is $(progress ? "enabled" : "disabled") globally"
4040
PROGRESS[] = progress
4141
AbstractMCMC.setprogress!(progress; silent=true)
42-
# TODO: `AdvancedVI.turnprogress` is removed in AdvancedVI v0.3
43-
AdvancedVI.turnprogress(progress)
4442
return progress
4543
end
4644

@@ -118,6 +116,9 @@ export
118116
# Variational inference - AdvancedVI
119117
vi,
120118
ADVI,
119+
q_locationscale,
120+
q_meanfield_gaussian,
121+
q_fullrank_gaussian,
121122
# ADTypes
122123
AutoForwardDiff,
123124
AutoReverseDiff,

0 commit comments

Comments
 (0)