-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7f3563
commit 2efffe2
Showing
16 changed files
with
266 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[deps] | ||
Bijectors = "76274a88-744f-5084-9051-94815aaf08c4" | ||
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656" | ||
Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Documenter | ||
using Turing | ||
# Need to import Distributions and Bijectors to generate docs for functions | ||
# from those packages. | ||
using Distributions | ||
using Bijectors | ||
|
||
using DocumenterInterLinks | ||
|
||
links = InterLinks( | ||
"DynamicPPL" => "https://turinglang.org/DynamicPPL.jl/stable/objects.inv", | ||
"AbstractPPL" => "https://turinglang.org/AbstractPPL.jl/dev/objects.inv", | ||
"ADTypes" => "https://sciml.github.io/ADTypes.jl/stable/objects.inv", | ||
) | ||
|
||
# Doctest setup | ||
DocMeta.setdocmeta!(Turing, :DocTestSetup, :(using Turing); recursive=true) | ||
|
||
makedocs(; | ||
sitename="Turing", | ||
modules=[Turing, Distributions, Bijectors], | ||
pages=[ | ||
"Home" => "index.md", | ||
"API" => "api.md", | ||
"Submodule APIs" => [ | ||
"Inference" => "api/Inference.md", | ||
"Optimisation" => "api/Optimisation.md", | ||
] | ||
], | ||
checkdocs=:exports, | ||
# checkdocs_ignored_modules=[Turing, Distributions, DynamicPPL, AbstractPPL, Bijectors], | ||
doctest=false, | ||
warnonly=true, | ||
plugins=[links], | ||
) | ||
|
||
deploydocs(; repo="github.com/TuringLang/Turing.jl.git", push_preview=true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
# API | ||
## Module-wide re-exports | ||
|
||
Turing.jl directly re-exports the entire public API of the following packages: | ||
|
||
- [Distributions.jl](https://juliastats.org/Distributions.jl) | ||
- [MCMCChains.jl](https://turinglang.org/MCMCChains.jl) | ||
- [AbstractMCMC.jl](https://turinglang.org/AbstractMCMC.jl) | ||
- [Bijectors.jl](https://turinglang.org/Bijectors.jl) | ||
- [Libtask.jl](https://github.com/TuringLang/Libtask.jl) | ||
|
||
Please see the individual packages for their documentation. | ||
|
||
## Individual exports and re-exports | ||
|
||
**All** of the following symbols are exported unqualified by Turing, even though the documentation suggests that many of them are qualified. | ||
That means, for example, you can just write | ||
|
||
```julia | ||
using Turing | ||
|
||
@model function my_model(...) | ||
|
||
sample(my_model(), Prior(), 100) | ||
``` | ||
|
||
instead of | ||
|
||
```julia | ||
sample(model, Turing.Inference.Prior(), 100) | ||
``` | ||
|
||
even though [`Prior()`](@ref) is actually defined in the `Turing.Inference` module. | ||
|
||
### Modelling | ||
|
||
| Exported symbol | Documentation | Description | | ||
| --- | --- | --- | | ||
| `@model` | [`DynamicPPL.@model`](@extref) | Define a probabilistic model | | ||
| `@varname` | [`AbstractPPL.@varname`](@extref) | Generate a `VarName` from a Julia expression | | ||
| `@submodel` | [`DynamicPPL.@submodel`](@extref) | Define a submodel | | ||
|
||
### Inference | ||
|
||
| Exported symbol | Documentation | Description | | ||
| --- | --- | --- | | ||
| `sample` | [`StatsBase.sample`](https://turinglang.org/AbstractMCMC.jl/stable/api/#Sampling-a-single-chain) | Sample from a model | | ||
|
||
### Samplers | ||
|
||
| Exported symbol | Documentation | Description | | ||
| --- | --- | --- | | ||
| `Prior` | [`Turing.Inference.Prior`](@ref) | Sample from the prior distribution | | ||
| `MH` | [`Turing.Inference.MH`](@ref) | Metropolis–Hastings | | ||
| `Emcee` | [`Turing.Inference.Emcee`](@ref) | Affine-invariant ensemble sampler | | ||
| `ESS` | [`Turing.Inference.ESS`](@ref) | Elliptical slice sampling | | ||
| `Gibbs` | [`Turing.Inference.Gibbs`](@ref) | Gibbs sampling | | ||
| `GibbsConditional` | [`Turing.Inference.GibbsConditional`](@ref) | A "pseudo-sampler" to provide analytical conditionals to `Gibbs` | | ||
| `HMC` | [`Turing.Inference.HMC`](@ref) | Hamiltonian Monte Carlo | | ||
| `SGLD` | [`Turing.Inference.SGLD`](@ref) | Stochastic gradient Langevin dynamics | | ||
| `SGHMC` | [`Turing.Inference.SGHMC`](@ref) | Stochastic gradient Hamiltonian Monte Carlo | | ||
| `HMCDA` | [`Turing.Inference.HMCDA`](@ref) | Hamiltonian Monte Carlo with dual averaging | | ||
| `NUTS` | [`Turing.Inference.NUTS`](@ref) | No-U-Turn Sampler | | ||
| `PolynomialStepsize` | [`Turing.Inference.PolynomialStepsize`](@ref) | A function to generate a polynomially decaying step size | | ||
| `IS` | [`Turing.Inference.IS`](@ref) | Importance sampling | | ||
| `SMC` | [`Turing.Inference.SMC`](@ref) | Sequential Monte Carlo | | ||
| `PG` | [`Turing.Inference.PG`](@ref) | Particle Gibbs | | ||
| `CSMC` | [`Turing.Inference.CSMC`](@ref) | The same as PG | | ||
| `externalsampler` | [`Turing.Inference.externalsampler`](@ref) | Wrap an external sampler for use in Turing | | ||
|
||
### Variational inference | ||
|
||
These functions are not (yet) formally documented. | ||
Please see the [variational inference tutorial](https://turinglang.org/docs/tutorials/09-variational-inference/) for a walkthrough on how to use these. | ||
|
||
TODO: Generate docs for AdvancedVI 0.2, update the InterLinks object.inv, and update the table below to include `@extref`. | ||
|
||
| Exported symbol | Documentation | Description | | ||
| --- | --- | --- | | ||
| `vi` | `AdvancedVI.vi` | Perform variational inference | | ||
| `ADVI` | `AdvancedVI.ADVI` | Construct an instance of a VI algorithm | | ||
|
||
### Automatic differentiation types | ||
|
||
These are used to specify the automatic differentiation backend to use. | ||
|
||
| Exported symbol | Documentation | Description | | ||
| --- | --- | --- | | ||
| `AutoForwardDiff` | [`ADTypes.AutoForwardDiff`](@extref) | ForwardDiff.jl backend | | ||
| `AutoReverseDiff` | [`ADTypes.AutoReverseDiff`](@extref) | ReverseDiff.jl backend | | ||
| `AutoZygote` | [`ADTypes.AutoZygote`](@extref) | Zygote.jl backend | | ||
| `AutoTracker` | [`ADTypes.AutoTracker`](@extref) | Tracker.jl backend | | ||
| `AutoTapir` | [`ADTypes.AutoTapir`](@extref) | Tapir.jl backend, only for ADTypes >= 1.0 | | ||
|
||
### Debugging | ||
|
||
```@docs | ||
setprogress! | ||
``` | ||
|
||
### Distributions | ||
|
||
These distributions are defined in Turing.jl, but not in Distributions.jl. | ||
|
||
```@docs | ||
Flat | ||
FlatPos | ||
BinomialLogit | ||
OrderedLogistic | ||
LogPoisson | ||
``` | ||
|
||
`BernoulliLogit` is part of Distributions.jl since version 0.25.77. | ||
If you are using an older version of Distributions where this isn't defined, Turing will export the same distribution. | ||
|
||
```@docs | ||
Distributions.BernoulliLogit | ||
``` | ||
|
||
### Tools to work with distributions | ||
|
||
TODO: DistributionsAD needs docs | ||
|
||
| Exported symbol | Documentation | Description | | ||
| --- | --- | --- | | ||
| `filldist` | `DistributionsAD.filldist` | Create a product distribution from a distribution and integers | | ||
| `arraydist` | `DistributionsAD.arraydist` | Create a product distribution from an array of distributions | | ||
| `NamedDist` | [`DynamicPPL.NamedDist`](@extref) | A distribution that carries the name of the variable | | ||
|
||
### Predictions | ||
|
||
```@docs | ||
predict | ||
``` | ||
|
||
### Re-exports from DynamicPPL / AbstractPPL | ||
|
||
| Exported symbol | Documentation | Description | | ||
| --- | --- | --- | | ||
| `pointwise_loglikelihoods` | [`DynamicPPL.pointwise_loglikelihoods`](@extref) | Compute log likelihoods for each sample in a chain | | ||
| `generated_quantities` | [`DynamicPPL.generated_quantities`](@extref) | Calculate additional quantities defined in a model | | ||
| `logprior` | [`DynamicPPL.logprior`](@extref) | Compute log prior probability | | ||
| `logjoint` | [`DynamicPPL.logjoint`](@extref) | Compute log joint probability | | ||
| `LogDensityFunction` | [`DynamicPPL.LogDensityFunction`](@extref) | Wrap a Turing model to satisfy LogDensityFunctions.jl interface | | ||
| `condition` | [`AbstractPPL.condition`](@extref) | Condition a model on data | | ||
| `decondition` | [`AbstractPPL.decondition`](@extref) | Remove conditioning on data | | ||
| `conditioned` | [`DynamicPPL.conditioned`](@extref) | Return the conditioned values of a model | | ||
| `fix` | [`DynamicPPL.fix`](@extref) | Fix the value of a variable | | ||
| `unfix` | [`DynamicPPL.unfix`](@extref) | Unfix the value of a variable | | ||
| `OrderedDict` | [`OrderedCollections.OrderedDict`](https://juliacollections.github.io/OrderedCollections.jl/dev/ordered_containers/#OrderedDicts) | An ordered dictionary | | ||
|
||
### Extra re-exports from Bijectors | ||
|
||
Note that Bijectors itself does not export `ordered`. | ||
|
||
```@docs | ||
Bijectors.ordered | ||
``` | ||
|
||
### Point estimates | ||
|
||
| Exported symbol | Documentation | Description | | ||
| --- | --- | --- | | ||
| `maximum_a_posteriori` | [`Turing.Optimisation.maximum_a_posteriori`](@ref) | Find a MAP estimate for a model | | ||
| `maximum_likelihood` | [`Turing.Optimisation.maximum_likelihood`](@ref) | Find a MLE estimate for a model | | ||
| `MAP` | [`Turing.Optimisation.MAP`](@ref) | Type to use with Optim.jl for MAP estimation | | ||
| `MLE` | [`Turing.Optimisation.MLE`](@ref) | Type to use with Optim.jl for MLE estimation | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# API: `Turing.Inference` | ||
|
||
```@autodocs | ||
Modules = [Turing.Inference] | ||
Order = [:type, :function] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# API: `Turing.Optimisation` | ||
|
||
```@autodocs | ||
Modules = [Turing.Optimisation] | ||
Order = [:type, :function] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Turing.jl | ||
|
||
This site contains the API documentation for the identifiers exported by Turing.jl. | ||
|
||
If you are looking for usage examples and guides, please visit [https://turinglang.org/docs](https://turinglang.org/docs). |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.