Skip to content

Commit 9b057c0

Browse files
authored
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
1 parent 36bc868 commit 9b057c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+318
-253
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
version:
20-
- '1.5'
20+
- '1.6'
21+
- '1.7'
2122
- '1'
2223
os:
2324
- ubuntu-latest

Project.toml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
name = "Soss"
22
uuid = "8ce77f84-9b61-11e8-39ff-d17a774bf41c"
33
author = ["Chad Scherrer <[email protected]>"]
4-
version = "0.20.9"
4+
version = "0.21.0"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
8+
DensityInterface = "b429d917-457f-4dbc-8f4c-0cc954292b1d"
89
DiffResults = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"
910
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
1011
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
1112
GeneralizedGenerated = "6b9d7cbe-bcb9-11e9-073f-15a7a543e2eb"
12-
IRTools = "7869d1d1-7146-5819-86e3-90919afe41df"
13+
IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"
1314
JuliaVariables = "b14d175d-62b4-44ba-8fb7-3064adc8c3ec"
1415
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1516
MLStyle = "d8e11817-5142-5d16-987a-aa16d5891078"
@@ -30,45 +31,46 @@ SimpleGraphs = "55797a34-41de-5266-9ec1-32ac4eb504d3"
3031
SimplePartitions = "ec83eff0-a5b5-5643-ae32-5cbf6eedec9d"
3132
SimplePosets = "b2aef97b-4721-5af9-b440-0bad754dc5ba"
3233
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
34+
Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
3335
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
3436
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
3537
StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
36-
SymbolicCodegen = "fc9b0551-4f1b-42e1-8440-e8a535f5a551"
3738
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
3839
TransformVariables = "84d833dd-6860-57f9-a1a7-6da5db126cff"
3940
TupleVectors = "615932cf-77b6-4358-adcd-5b7eba981d7e"
4041

4142
[compat]
42-
ArrayInterface = "3"
43+
ArrayInterface = "5,6"
44+
DensityInterface = "0.4"
4345
DiffResults = "1"
4446
Distributions = "0.23, 0.24, 0.25"
45-
FillArrays = "0.10, 0.11, 0.12"
47+
FillArrays = "0.11, 0.12, 0.13"
4648
GeneralizedGenerated = "0.3"
47-
IRTools = "0.4"
49+
IfElse = "0.1"
4850
JuliaVariables = "0.2"
4951
MLStyle = "0.3,0.4"
5052
MacroTools = "0.5"
5153
MappedArrays = "0.3, 0.4"
52-
MeasureBase = "0.5"
53-
MeasureTheory = "0.13"
54-
NamedTupleTools = "0.12, 0.13"
55-
NestedTuples = "0.3"
56-
RecipesBase = "0.7,0.8, 1"
54+
MeasureBase = "0.9"
55+
MeasureTheory = "0.16"
56+
NamedTupleTools = "0.12, 0.13, 0.14"
57+
NestedTuples = "0.3.9"
58+
RecipesBase = "1"
5759
Reexport = "1"
5860
Requires = "1"
5961
RuntimeGeneratedFunctions = "0.5"
6062
SampleChains = "0.5"
6163
SimpleGraphs = "0.5, 0.6, 0.7"
6264
SimplePartitions = "0.2, 0.3"
63-
SimplePosets = "0.0, 0.1"
64-
SpecialFunctions = "0.9, 0.10, 1"
65+
SimplePosets = "0.1"
66+
SpecialFunctions = "1, 2"
67+
Static = "0.5, 0.6"
6568
StatsBase = "0.33"
66-
StatsFuns = "0.9"
67-
SymbolicCodegen = "0.2"
68-
SymbolicUtils = "0.15, 0.16, 0.17"
69-
TransformVariables = "0.4"
69+
StatsFuns = "0.9, 1"
70+
SymbolicUtils = "0.17, 0.18, 0.19"
71+
TransformVariables = "0.5, 0.6"
7072
TupleVectors = "0.1"
71-
julia = "1.5"
73+
julia = "1.6"
7274

7375
[extras]
7476
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"

demos/boundmodels.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ m(μ=1.0)
1010

1111
rand(m=1.0))
1212

13-
logdensity(m=1.0),(x=0.4,))
13+
logdensityof(m=1.0),(x=0.4,))
1414
# rand(m1)
1515

1616
weightedSample(m=1.0),(x=3,))

demos/hmm.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ end
5353
end
5454
end
5555

56-
# function Distributions.logdensity(c::Chain, xs)
56+
# function Distributions.logdensityof(c::Chain, xs)
5757

5858
c = Chain(s0, step)
5959

demos/repeated-measurements.jmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ for t in symlogdensity(m()).evalf(3).args
9292

9393
<!--
9494
using BenchmarkTools
95-
@btime logdensity(m(),truth)
96-
@btime logdensity(m(),truth, codegen)
95+
@btime logdensityof(m(),truth)
96+
@btime logdensityof(m(),truth, codegen)
9797

9898
f1 = Soss._codegen(m, true);
9999
f2 = Soss._codegen(m,false);
@@ -105,7 +105,7 @@ codegen(m(),truth)
105105

106106

107107

108-
logdensity(m(), merge(truth, (p_bad=shuffle(truth.p_bad),)), codegen)
108+
logdensityof(m(), merge(truth, (p_bad=shuffle(truth.p_bad),)), codegen)
109109

110110

111111
@time result = dynamicHMC(m(), (y=truth.y,), codegen) ;

demos/repeated-measurements.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ _j1 = 1 _j2 = 1
192192

193193
<!--
194194
using BenchmarkTools
195-
@btime logdensity(m(),truth)
196-
@btime logdensity(m(),truth, codegen)
195+
@btime logdensityof(m(),truth)
196+
@btime logdensityof(m(),truth, codegen)
197197
198198
f1 = Soss._codegen(m, true);
199199
f2 = Soss._codegen(m,false);
@@ -205,7 +205,7 @@ codegen(m(),truth)
205205
206206
207207
208-
logdensity(m(), merge(truth, (p_bad=shuffle(truth.p_bad),)), codegen)
208+
logdensityof(m(), merge(truth, (p_bad=shuffle(truth.p_bad),)), codegen)
209209
210210
211211
@time result = dynamicHMC(m(), (y=truth.y,), codegen) ;

docs/src/misc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function sourceWeightedSample(_data)
6565
proc(_m, st :: LineNumber) = nothing
6666

6767
function proc(_m, st :: Sample)
68-
st.x _datakeys && return :(_ℓ += logdensity($(st.rhs), $(st.x)))
68+
st.x _datakeys && return :(_ℓ += logdensity_def($(st.rhs), $(st.x)))
6969
return :($(st.x) = rand($(st.rhs)))
7070
end
7171

scratchpad/MCM.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function expect(x,ℓ)
77
end
88

99
x = Particles(5000,TDist(3))
10-
= logpdf(Normal(),x) - logpdf(TDist(3), x)
10+
= logdensityof(Normal(),x) - logdensityof(TDist(3), x)
1111

1212
expect(x,ℓ)
1313
expect(x^2,ℓ)
@@ -26,7 +26,7 @@ expect(z^4,ℓ)
2626
# And now a new weighted variable
2727

2828
y = Particles(5000,TDist(3))
29-
+= logpdf(Normal(),y) - logpdf(TDist(3), y)
29+
+= logdensityof(Normal(),y) - logdensityof(TDist(3), y)
3030

3131
expect(y,ℓ)
3232
expect(y^2,ℓ)

scratchpad/SampleChainsDynamicHMC-demo.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ plot(p, exp.([ℓ((p=pj,)) for pj in p]))
4444

4545
using TransformVariables
4646

47-
(x) = logdensity(Beta(4,3), x.p)
48-
t = xform(post)
47+
(x) = logdensity_def(Beta(4,3), x.p)
48+
t = as(post)
4949
chain = initialize!(DynamicHMCChain, ℓ, t)
5050
drawsamples!(chain, 10000)
5151
plot(ash(chain.p))

scratchpad/advancedhmc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ D = 10; initial_θ = rand(D)
66
dist = Normal() ^ D
77

88
# Define the target distribution
9-
ℓπ(θ) = logdensity(dist, θ)
9+
ℓπ(θ) = logdensity_def(dist, θ)
1010

1111
# Set the number of samples to draw and warmup iterations
1212
n_samples, n_adapts = 2_000, 1_000

0 commit comments

Comments
 (0)