Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First steps toward factoring out TransformVariables #237

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
TransformVariables = "84d833dd-6860-57f9-a1a7-6da5db126cff"
Tricks = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775"

[compat]
Expand Down Expand Up @@ -70,7 +69,6 @@ Static = "0.5, 0.6"
StaticArraysCore = "1"
StatsBase = "0.32, 0.33"
StatsFuns = "0.9, 1"
TransformVariables = "0.5, 0.6, 0.7"
Tricks = "0.1"
julia = "1.6"

Expand Down
17 changes: 7 additions & 10 deletions src/MeasureTheory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ using Random

using MeasureBase
using MLStyle
import TransformVariables
const TV = TransformVariables

using DistributionMeasures
using TransformVariables: asℝ₊, as𝕀, asℝ, transform
# using TransformVariables: asℝ₊, as𝕀, asℝ, transform

import Base
import Distributions
const Dists = Distributions

export TV
export transform
export ≪
export gentype
Expand Down Expand Up @@ -120,7 +117,7 @@ xlog1py(x, y) = x * log(1 + y)
as(args...; kwargs...) = TV.as(args...; kwargs...)

include("utils.jl")
include("const.jl")
# include("const.jl")
include("combinators/for.jl")
# include("traits.jl")
include("parameterized.jl")
Expand All @@ -129,13 +126,13 @@ include("macros.jl")
include("combinators/affine.jl")
include("combinators/weighted.jl")
include("combinators/product.jl")
include("combinators/transforms.jl")
# include("combinators/transforms.jl")
include("combinators/exponential-families.jl")
include("resettable-rng.jl")
include("realized.jl")
include("combinators/chain.jl")

include("distributions.jl")
# include("distributions.jl")
include("smart-constructors.jl")

include("parameterized/normal.jl")
Expand All @@ -153,7 +150,7 @@ include("parameterized/bernoulli.jl")
include("parameterized/poisson.jl")
include("parameterized/binomial.jl")
include("parameterized/multinomial.jl")
include("parameterized/lkj-cholesky.jl")
# include("parameterized/lkj-cholesky.jl")
include("parameterized/negativebinomial.jl")
include("parameterized/betabinomial.jl")
include("parameterized/gamma.jl")
Expand All @@ -162,8 +159,8 @@ include("parameterized/inverse-gaussian.jl")

include("combinators/ifelse.jl")

include("transforms/corrcholesky.jl")
include("transforms/ordered.jl")
# include("transforms/corrcholesky.jl")
# include("transforms/ordered.jl")

include("distproxy.jl")
end # module
2 changes: 2 additions & 0 deletions src/combinators/affine.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ function Pretty.tile(d::AffinePushfwd)
Pretty.list_layout([pars, Pretty.tile(d.parent)]; prefix = :AffinePushfwd)
end



@inline function testvalue(d::AffinePushfwd)
f = getfield(d, :f)
z = testvalue(parent(d))
Expand Down