Skip to content

Commit

Permalink
Try #417:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored Nov 3, 2022
2 parents 0457785 + d715b0c commit b699f6b
Show file tree
Hide file tree
Showing 19 changed files with 1,383 additions and 463 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "DynamicPPL"
uuid = "366bfd00-2699-11ea-058f-f148b4cae6d8"
version = "0.20.2"
version = "0.21.0"

[deps]
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
Expand Down
4 changes: 3 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ using DynamicPPL
using DynamicPPL: AbstractPPL

# Doctest setup
DocMeta.setdocmeta!(DynamicPPL, :DocTestSetup, :(using DynamicPPL); recursive=true)
DocMeta.setdocmeta!(
DynamicPPL, :DocTestSetup, :(using DynamicPPL, Distributions); recursive=true
)

makedocs(;
sitename="DynamicPPL",
Expand Down
35 changes: 33 additions & 2 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,23 +154,56 @@ AbstractVarInfo

### Common API

#### Accumulation of log-probabilities

```@docs
getlogp
setlogp!!
acclogp!!
resetlogp!!
```

#### Variables and their realizations

```@docs
keys
getindex
DynamicPPL.getindex_raw
push!!
empty!!
isempty
```

```@docs
values_as
```

#### Transformations

```@docs
DynamicPPL.AbstractTransformation
DynamicPPL.NoTransformation
DynamicPPL.DynamicTransformation
DynamicPPL.StaticTransformation
```

```@docs
DynamicPPL.istrans
DynamicPPL.settrans!!
DynamicPPL.transformation
DynamicPPL.link!!
DynamicPPL.invlink!!
DynamicPPL.default_transformation
DynamicPPL.maybe_invlink_before_eval!!
```

#### Utils

```@docs
DynamicPPL.unflatten
DynamicPPL.tonamedtuple
```

#### `SimpleVarInfo`

```@docs
Expand All @@ -189,10 +222,8 @@ TypedVarInfo
One main characteristic of [`VarInfo`](@ref) is that samples are stored in a linearized form.

```@docs
tonamedtuple
link!
invlink!
istrans
```

```@docs
Expand Down
15 changes: 12 additions & 3 deletions src/DynamicPPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ export AbstractVarInfo,
setorder!,
istrans,
link!,
link!!,
invlink!,
invlink!!,
tonamedtuple,
values_as,
# VarName (reexport from AbstractPPL)
Expand Down Expand Up @@ -125,27 +127,33 @@ export loglikelihood
# Used here and overloaded in Turing
function getspace end

# Necessary forward declarations
"""
AbstractVarInfo
Abstract supertype for data structures that capture random variables when executing a
probabilistic model and accumulate log densities such as the log likelihood or the
log joint probability of the model.
See also: [`VarInfo`](@ref)
See also: [`VarInfo`](@ref), [`SimpleVarInfo`](@ref).
"""
abstract type AbstractVarInfo <: AbstractModelTrace end

const LEGACY_WARNING = """
!!! warning
This method is considered legacy, and is likely to be deprecated in the future.
"""

# Necessary forward declarations
include("utils.jl")
include("selector.jl")
include("model.jl")
include("sampler.jl")
include("varname.jl")
include("distribution_wrappers.jl")
include("contexts.jl")
include("varinfo.jl")
include("abstract_varinfo.jl")
include("threadsafe.jl")
include("varinfo.jl")
include("simple_varinfo.jl")
include("context_implementations.jl")
include("compiler.jl")
Expand All @@ -154,5 +162,6 @@ include("compat/ad.jl")
include("loglikelihoods.jl")
include("submodel_macro.jl")
include("test_utils.jl")
include("transforming.jl")

end # module
Loading

0 comments on commit b699f6b

Please sign in to comment.