From 9b057c011e33eca6b4205178e2ac29ff6d5461fb Mon Sep 17 00:00:00 2001 From: Chad Scherrer Date: Tue, 24 May 2022 12:58:22 -0700 Subject: [PATCH] Dev (#332) * update Project.toml * s/logpdf/logdensity/ * update deps * scratchpad * version bump * representative => rootmeasure * update dependency versions * reduce dependencies * update deps * scratchpad * representative => rootmeasure * update dependency versions * reduce dependencies * `as` methods for `xform` * cleanup * require latest MeasureTheory * dorp old distributions code * drop old iid code * drop extra space * limit deps to three newest releases * update dynamichmc * add Aqua * bump version * Better `predict` method * withmeasures(::ConditionalModel) * update dependencies * updating symbolics * some updates to symbolics * hmm example * update MeasureBase bound * better dispatch for `predict` * drop redundant method * remove whitespace * bump version * update for upcoming MeasureTheory release * small change to toposort * have `iid` use powermeasure * tests passing! * iid(n::Integer...) * update dependencies * start logdensity with partialstatic * update test to account for partialstatic * add `insupport` * clean up insupport * speed up model building * updates * starting updates for new MeasureTheory stuff * get tests passing * Kleisli => TransitionKernel * bump MB dependency version * Kleisli => TransitionKernel * tests passing * update dependencies * update CI * Should only need BayesianLinearRegression for testing * bump version --- .github/workflows/ci.yml | 3 +- Project.toml | 38 ++++++------ demos/boundmodels.jl | 2 +- demos/hmm.jl | 2 +- demos/repeated-measurements.jmd | 6 +- demos/repeated-measurements.md | 6 +- docs/src/misc.md | 2 +- scratchpad/MCM.jl | 4 +- scratchpad/SampleChainsDynamicHMC-demo.jl | 4 +- scratchpad/advancedhmc.jl | 2 +- scratchpad/bouncy.jl | 4 +- scratchpad/codegen.jl | 2 +- scratchpad/composition.jl | 8 +-- scratchpad/composition2.jl | 2 +- scratchpad/example-linear-regression.jl | 2 +- scratchpad/flux.jl | 2 +- scratchpad/gps.jl | 2 +- scratchpad/hmm.jl | 44 ++++++++++---- scratchpad/repeated-measurements-example.jl | 10 ++-- scratchpad/s4.jl | 10 ++-- scratchpad/stheno.jl | 2 +- scratchpad/trying_out_tuplevectors.jl | 4 +- scratchpad/vis.jl | 10 ++-- scratchpad/vis2.jl | 22 +++---- src/Soss.jl | 37 +++++++----- src/bayeslm.jl | 4 +- src/core/models/abstractmodel.jl | 13 +++-- src/core/models/conditional.jl | 2 +- src/core/toposort.jl | 4 +- src/core/utils.jl | 39 +++++++++---- src/distributions/dist.jl | 4 +- src/distributions/iid.jl | 6 +- src/exponentialfamilies.jl | 6 +- src/importance.jl | 10 ++-- src/inference/advancedhmc.jl | 4 +- src/inference/dynamicHMC.jl | 12 ++-- src/inference/power-posterior.jl | 2 +- src/inference/rejection.jl | 20 +++---- src/optim.jl | 2 +- src/primitives/{xform.jl => as.jl} | 36 ++++++------ src/primitives/basemeasure.jl | 10 ++-- src/primitives/bijectors.jl | 2 +- src/primitives/insupport.jl | 49 ++++++++++++++++ src/primitives/likelihood-weighting.jl | 2 +- src/primitives/logdensity.jl | 65 +++------------------ src/samplechains/dynamichmc.jl | 4 +- src/scratch/bouncy.jl | 4 +- src/scratch/zigzag.jl | 2 +- src/symbolic/symbolic.jl | 4 +- src/transforms/utils.jl | 3 +- test/linear-model.jl | 4 +- test/runtests.jl | 28 ++++++--- 52 files changed, 318 insertions(+), 253 deletions(-) rename src/primitives/{xform.jl => as.jl} (64%) create mode 100644 src/primitives/insupport.jl diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18f68d48..280cb579 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,8 @@ jobs: fail-fast: false matrix: version: - - '1.5' + - '1.6' + - '1.7' - '1' os: - ubuntu-latest diff --git a/Project.toml b/Project.toml index 44b8f5c0..4b181067 100644 --- a/Project.toml +++ b/Project.toml @@ -1,15 +1,16 @@ name = "Soss" uuid = "8ce77f84-9b61-11e8-39ff-d17a774bf41c" author = ["Chad Scherrer "] -version = "0.20.9" +version = "0.21.0" [deps] ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" +DensityInterface = "b429d917-457f-4dbc-8f4c-0cc954292b1d" DiffResults = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b" GeneralizedGenerated = "6b9d7cbe-bcb9-11e9-073f-15a7a543e2eb" -IRTools = "7869d1d1-7146-5819-86e3-90919afe41df" +IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" JuliaVariables = "b14d175d-62b4-44ba-8fb7-3064adc8c3ec" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MLStyle = "d8e11817-5142-5d16-987a-aa16d5891078" @@ -30,45 +31,46 @@ SimpleGraphs = "55797a34-41de-5266-9ec1-32ac4eb504d3" SimplePartitions = "ec83eff0-a5b5-5643-ae32-5cbf6eedec9d" SimplePosets = "b2aef97b-4721-5af9-b440-0bad754dc5ba" SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" +Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c" -SymbolicCodegen = "fc9b0551-4f1b-42e1-8440-e8a535f5a551" SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b" TransformVariables = "84d833dd-6860-57f9-a1a7-6da5db126cff" TupleVectors = "615932cf-77b6-4358-adcd-5b7eba981d7e" [compat] -ArrayInterface = "3" +ArrayInterface = "5,6" +DensityInterface = "0.4" DiffResults = "1" Distributions = "0.23, 0.24, 0.25" -FillArrays = "0.10, 0.11, 0.12" +FillArrays = "0.11, 0.12, 0.13" GeneralizedGenerated = "0.3" -IRTools = "0.4" +IfElse = "0.1" JuliaVariables = "0.2" MLStyle = "0.3,0.4" MacroTools = "0.5" MappedArrays = "0.3, 0.4" -MeasureBase = "0.5" -MeasureTheory = "0.13" -NamedTupleTools = "0.12, 0.13" -NestedTuples = "0.3" -RecipesBase = "0.7,0.8, 1" +MeasureBase = "0.9" +MeasureTheory = "0.16" +NamedTupleTools = "0.12, 0.13, 0.14" +NestedTuples = "0.3.9" +RecipesBase = "1" Reexport = "1" Requires = "1" RuntimeGeneratedFunctions = "0.5" SampleChains = "0.5" SimpleGraphs = "0.5, 0.6, 0.7" SimplePartitions = "0.2, 0.3" -SimplePosets = "0.0, 0.1" -SpecialFunctions = "0.9, 0.10, 1" +SimplePosets = "0.1" +SpecialFunctions = "1, 2" +Static = "0.5, 0.6" StatsBase = "0.33" -StatsFuns = "0.9" -SymbolicCodegen = "0.2" -SymbolicUtils = "0.15, 0.16, 0.17" -TransformVariables = "0.4" +StatsFuns = "0.9, 1" +SymbolicUtils = "0.17, 0.18, 0.19" +TransformVariables = "0.5, 0.6" TupleVectors = "0.1" -julia = "1.5" +julia = "1.6" [extras] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" diff --git a/demos/boundmodels.jl b/demos/boundmodels.jl index 4e420561..c7b02c08 100644 --- a/demos/boundmodels.jl +++ b/demos/boundmodels.jl @@ -10,7 +10,7 @@ m(μ=1.0) rand(m(μ=1.0)) -logdensity(m(μ=1.0),(x=0.4,)) +logdensityof(m(μ=1.0),(x=0.4,)) # rand(m1) weightedSample(m(μ=1.0),(x=3,)) diff --git a/demos/hmm.jl b/demos/hmm.jl index 8f29fb44..3d54cf04 100644 --- a/demos/hmm.jl +++ b/demos/hmm.jl @@ -53,7 +53,7 @@ end end end -# function Distributions.logdensity(c::Chain, xs) +# function Distributions.logdensityof(c::Chain, xs) c = Chain(s0, step) diff --git a/demos/repeated-measurements.jmd b/demos/repeated-measurements.jmd index 872c2113..bf692ea8 100644 --- a/demos/repeated-measurements.jmd +++ b/demos/repeated-measurements.jmd @@ -92,8 +92,8 @@ for t in symlogdensity(m()).evalf(3).args