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

Add HierarchicalMeasure #120

Closed
wants to merge 133 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
03f2890
Remove PowerWeightedMeasure
oschulz Jun 22, 2023
eac3622
Remove kernelfactor
oschulz Jun 22, 2023
b38d141
Rename pullback to pullbck and export it
oschulz Jun 22, 2023
eccc203
Rename bind to mbind and deprecate rightarrowtail
oschulz Jun 22, 2023
49c58c1
Introduce mintegrate and mintegrate_exp
oschulz Jun 22, 2023
ce7c5be
Remove the rebase function
oschulz Jun 22, 2023
debaea2
Rename bind to mbind and remove fish operator
oschulz Jun 22, 2023
1401086
Change field order of Bind and improve docs.
oschulz Jun 23, 2023
13f4129
Remove operator otimes
oschulz Jun 22, 2023
01e4f89
Removes PointwiseProductMeasure
oschulz Jun 22, 2023
55c12d7
Remove scrd operator
oschulz Jun 22, 2023
5dd3fe5
Remove ll-operator
oschulz Jun 22, 2023
49cd776
Add measure operators in submodule MeasureOperators
oschulz Jun 22, 2023
62c1eef
Improve docstring for mbind
oschulz Jun 23, 2023
3b5b8e0
Improve likelihood docs
oschulz Jun 23, 2023
24a1023
Apply JuliaFormatter
oschulz Jun 23, 2023
3bf6b0e
Improve Likelihood ctor
oschulz Jun 23, 2023
b60b574
Fix typo in _mintegrate_exp_impl exception
oschulz Jun 29, 2023
f72c6dd
Add HierarchicalMeasure
oschulz Jun 29, 2023
7157642
Rename local_measure, change insupprt handling
oschulz Jun 29, 2023
4acbed9
Don't require primary in HierarchicalMeasure to have known DOF
oschulz Jun 29, 2023
d1f31ba
STASH
oschulz Jun 29, 2023
13cf10b
STASH
oschulz Jun 29, 2023
566e350
STASH
oschulz Jun 29, 2023
8532cb8
STASH mbind
oschulz Jun 29, 2023
bc97abe
STASH hierarchical to bind
oschulz Jun 29, 2023
f9ef620
Add function asmeasure
oschulz Jun 29, 2023
c51a82e
STASH
oschulz Jun 29, 2023
3794983
STASH
oschulz Jun 29, 2023
4b5b7a0
STASH
oschulz Jun 30, 2023
6519234
STASH
oschulz Jun 30, 2023
7a4e85d
STASH
oschulz Jun 30, 2023
a94adf8
STASH _to_mvstd _to_mvstd
oschulz Jun 30, 2023
d69b9a0
STASH
oschulz Jun 30, 2023
d9b3f0d
STASH FIXUP
oschulz Jun 30, 2023
c05c545
STASH
oschulz Jun 30, 2023
40cf99d
STASH
oschulz Jun 30, 2023
ef64ed8
STASH
oschulz Jun 30, 2023
b04684a
STASH
oschulz Jun 30, 2023
710b8f1
STASH
oschulz Jul 1, 2023
8d38eee
STASH
oschulz Jul 1, 2023
166b648
STASH
oschulz Jul 1, 2023
840c166
Remove remnants of pointwiseproduct
oschulz Jul 1, 2023
c0b22e1
STASH
oschulz Jul 1, 2023
11ebdd6
STASH
oschulz Jul 1, 2023
58b3457
STASH
oschulz Jul 1, 2023
83da526
STASH fast_dof
oschulz Jul 1, 2023
10b7fd0
STASH
oschulz Jul 1, 2023
a868233
STASH
oschulz Jul 1, 2023
8d1a211
STASH
oschulz Jul 1, 2023
2c21ced
STASH
oschulz Jul 1, 2023
31c227c
STASH
oschulz Jul 1, 2023
8af4763
STASH
oschulz Jul 1, 2023
c28e854
Add StaticArrays to deps
oschulz Jul 1, 2023
5917a5c
STASH
oschulz Jul 1, 2023
94cfd3b
STASH
oschulz Jul 1, 2023
d958c51
STASH FIXES
oschulz Jul 1, 2023
4d8b175
STASH
oschulz Jul 2, 2023
ba6f700
STASH
oschulz Jul 2, 2023
79c72cb
STASH FIXES
oschulz Jul 2, 2023
2da9029
STASH FIXES
oschulz Jul 2, 2023
8c8d4e8
FIXES
oschulz Jul 2, 2023
71674c3
FIXUP StaticArrays dep
oschulz Jul 2, 2023
9a602ad
FIXES
oschulz Jul 2, 2023
1d2cb8f
FIXUP
oschulz Jul 2, 2023
074983f
STASH
oschulz Jul 2, 2023
d6e8022
STASH
oschulz Jul 2, 2023
a708815
FIXES
oschulz Jul 2, 2023
7422be1
FIXES
oschulz Jul 2, 2023
b062e0a
Add ArraysOfArrays to deps
oschulz Jul 2, 2023
28cac4f
STASH FIXES
oschulz Jul 2, 2023
ddf1f26
STASH FIXES
oschulz Jul 2, 2023
fadbd83
STASH
oschulz Jul 2, 2023
fa58a39
STASH
oschulz Jul 2, 2023
9ad36f3
STASH
oschulz Jul 4, 2023
32c903c
STASH
oschulz Jul 4, 2023
cc7a724
STASH
oschulz Jul 4, 2023
b3fb6fa
STASH
oschulz Jul 4, 2023
0279e3d
STASH pwr rand incomplete
oschulz Jul 4, 2023
8261107
STASH rand
oschulz Jul 4, 2023
f73c1fe
STASH FIXES
oschulz Jul 4, 2023
36956da
Specialize pushfwd and pullbck for DensityMeasure
oschulz Jul 16, 2023
39a70dc
Add OneTwoMany to deps
oschulz Jul 16, 2023
a049b67
STASH furtther specialize bind and combined
oschulz Jul 16, 2023
498e967
STASH smart ctors, canonical measure nesting
oschulz Jul 16, 2023
04c9a76
STASH Change pushfwd/pullback specialialization for DensityMeasure
oschulz Jul 17, 2023
2f8c2c6
STASH Allow single-arg mbind and friends
oschulz Jul 17, 2023
09067d7
Checking insupport in PushforwardMeasure would be to expensive
oschulz Jul 17, 2023
e0f9980
comment out duplicate
cscherrer Aug 29, 2023
5d4f458
fix typo
cscherrer Aug 29, 2023
7438bc8
drop 2-argument `basemeasure`
cscherrer Aug 29, 2023
ae2eeb5
bugfixes
cscherrer Aug 29, 2023
af0c68f
comment out questionable code
cscherrer Aug 29, 2023
f6a2539
oops my mistake
cscherrer Aug 29, 2023
7a48e34
depend on ConstantRNGs.jl
cscherrer Sep 1, 2023
865797a
fix typo
cscherrer Sep 5, 2023
6746e47
drop `fixedrng.jl` (using ConstantRNGs.jl instead)
cscherrer Sep 6, 2023
7a5f4e1
Optimize product measures when `Base.issingltetontype`
cscherrer Sep 6, 2023
60509bd
small change to make JET happy
cscherrer Sep 6, 2023
adc729d
bugfix
cscherrer Sep 7, 2023
a0ace73
bugfix
cscherrer Sep 20, 2023
b95b1a1
bugfix
cscherrer Sep 20, 2023
303f8f1
make _dynamic work for empty ranges
cscherrer Sep 20, 2023
999c39e
fix type instability
cscherrer Sep 20, 2023
8fe3b14
specialize _dynamic(::Base.OneTo)
cscherrer Sep 20, 2023
29f2c21
Integer => IntegerLike
cscherrer Sep 20, 2023
e495c04
Simplify, drop _reorder_nt
cscherrer Sep 20, 2023
d49f63f
fix tuple methods
cscherrer Sep 21, 2023
115e0c6
small bugfixes (issues caught by JET)
cscherrer Sep 21, 2023
42ec20f
Change `...stage3` call to `...stage1` (there is no stage 3)
cscherrer Sep 21, 2023
760faff
fix a Dirac call (`.value` => `.x`)
cscherrer Sep 21, 2023
24964bb
Fixing another Dirac
cscherrer Sep 21, 2023
886f927
nit-picking
cscherrer Sep 21, 2023
1c9f69e
specialize transports between StdPowerMeasures with the same base
cscherrer Sep 21, 2023
f1274fc
addition to docstring in bind.jl
HannahMeilchen Oct 23, 2023
4ac8b78
fixed _split_after in collection_utils.jl
HannahMeilchen Oct 23, 2023
5c2bedb
Temporary change to mbind constructor:
HannahMeilchen Oct 24, 2023
dd5c902
added a rand function to lebesgue.jl,
HannahMeilchen Oct 24, 2023
b6ae089
fixed _eval_k
HannahMeilchen Oct 25, 2023
cd511f8
rand on Lebesgue doesn't make sense in general
HannahMeilchen Oct 26, 2023
75b0cae
extension to insupport for PreoductMeasures
HannahMeilchen Oct 26, 2023
80d372e
change to insupport for PowerMeasures,
HannahMeilchen Oct 26, 2023
c5d5e11
fixed docstring about mintegral, mintegral_exp
HannahMeilchen Oct 26, 2023
c3f8c5c
explained example in docstring
HannahMeilchen Oct 26, 2023
e18c0cc
change to insupport:
HannahMeilchen Oct 27, 2023
eae9a75
completed docstring bind.jl
HannahMeilchen Oct 27, 2023
0a6646b
typo in docstring
HannahMeilchen Oct 27, 2023
5c4ae2c
Require OneTwoMany v0.1.2 for secondarg
oschulz Nov 7, 2023
63ee36f
STASH add mkernel and MKernel
oschulz Nov 7, 2023
336c1d2
FIXUP secondarg
oschulz Nov 7, 2023
8dbdc52
STASH mkernel
oschulz Nov 7, 2023
56157f9
STASH bindkernel and boundmeasure
oschulz Nov 7, 2023
2d017c9
STASH bind
oschulz Nov 7, 2023
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
8 changes: 8 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ authors = ["Chad Scherrer <chad.scherrer@gmail.com>", "Oliver Schulz <oschulz@mp
version = "0.14.10"

[deps]
ArraysOfArrays = "65a8f2f4-9b39-5baf-92e2-a9cc46fdf018"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
ConstantRNGs = "aa9b60e7-6b1c-4c29-a6e5-e43521412437"
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
DensityInterface = "b429d917-457f-4dbc-8f4c-0cc954292b1d"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
Expand All @@ -20,19 +22,23 @@ LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
LogarithmicNumbers = "aa2f6b4e-9042-5d33-9679-40d3a6b85899"
MappedArrays = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900"
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
OneTwoMany = "762dc654-8631-413a-a342-372a7419ad9d"
PrettyPrinting = "54e16d92-306c-5ea0-a30b-337be88ac337"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Tricks = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775"

[compat]
ArraysOfArrays = "0.6"
ChainRulesCore = "1"
ChangesOfVariables = "0.1.3"
Compat = "3.35, 4"
ConstantRNGs = "0.1"
ConstructionBase = "1.3"
DensityInterface = "0.4"
FillArrays = "0.12, 0.13, 1"
Expand All @@ -46,12 +52,14 @@ LogExpFunctions = "0.3"
LogarithmicNumbers = "1"
MappedArrays = "0.4"
NaNMath = "0.3, 1"
OneTwoMany = "0.1.2"
PrettyPrinting = "0.3, 0.4"
Random = "1"
Reexport = "1"
SpecialFunctions = "2"
Static = "0.8, 1"
Statistics = "1"
Test = "1"
StaticArrays = "1.5"
Tricks = "0.1"
julia = "1.6"
126 changes: 0 additions & 126 deletions ambiguity-fixes.jl.txt

This file was deleted.

61 changes: 41 additions & 20 deletions src/MeasureBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Random: gentype
using Statistics
using LinearAlgebra

using ConstantRNGs
import IntervalSets
# This seems harder than it should be to get `IntervalSets.:(..)`
@eval (using IntervalSets: $(Symbol(IntervalSets.:(..))))
Expand All @@ -27,30 +28,32 @@ import Base.iterate
import ConstructionBase
using ConstructionBase: constructorof
using IntervalSets
using OneTwoMany: firstarg, secondarg

using PrettyPrinting
const Pretty = PrettyPrinting

using ArraysOfArrays

using ChainRulesCore
import FillArrays
using Static
using Static: StaticInteger
using FunctionChains

export ≪
import StaticArrays
using StaticArrays: StaticArray, StaticVector, StaticMatrix, SArray, SVector, SMatrix

export gentype
export rebase

export AbstractMeasure

import IfElse: ifelse
export logdensity_def
export basemeasure
export basekernel
export productmeasure

export insupport
export getdof
export transport_to

include("insupport.jl")
Expand All @@ -59,6 +62,21 @@ abstract type AbstractMeasure end

AbstractMeasure(m::AbstractMeasure) = m


"""
asmeasure(m)

Turns a measure-like object `m` into an `AbstractMeasure`.

Calls `convert(AbstractMeasure, m)` by default
"""
function asmeasure end

@inline asmeasure(m::AbstractMeasure) = m
asmeasure(m) = convert(AbstractMeasure, m)
export asmeasure


function Pretty.quoteof(d::M) where {M<:AbstractMeasure}
the_names = fieldnames(typeof(d))
:($M($([getfield(d, n) for n in the_names]...)))
Expand Down Expand Up @@ -108,54 +126,57 @@ using Compat
using IrrationalConstants

include("static.jl")
include("collection_utils.jl")
include("smf.jl")
include("getdof.jl")
include("transport.jl")
include("schema.jl")
include("splat.jl")
include("proxies.jl")
include("kernel.jl")
include("parameterized.jl")
include("domains.jl")
include("primitive.jl")
include("utils.jl")
include("mass-interface.jl")
include("density.jl")
include("density-core.jl")

include("proxies.jl")
# include("absolutecontinuity.jl")

include("primitives/counting.jl")
include("primitives/lebesgue.jl")
include("primitives/dirac.jl")
include("primitives/trivial.jl")

include("combinators/bind.jl")
include("standard/stdmeasure.jl")
include("standard/stduniform.jl")
include("standard/stdexponential.jl")
include("standard/stdlogistic.jl")
include("standard/stdnormal.jl")

include("combinators/abstract_product.jl")
include("combinators/power.jl")
include("combinators/product.jl")
include("combinators/product_transport.jl")
include("combinators/transformedmeasure.jl")
include("combinators/weighted.jl")
include("combinators/superpose.jl")
include("combinators/product.jl")
include("combinators/power.jl")
include("combinators/combined.jl")
include("combinators/bind.jl")
include("combinators/spikemixture.jl")
include("combinators/likelihood.jl")
include("combinators/pointwise.jl")
include("combinators/restricted.jl")
include("combinators/smart-constructors.jl")
include("combinators/powerweighted.jl")
include("combinators/conditional.jl")

include("standard/stdmeasure.jl")
include("standard/stduniform.jl")
include("standard/stdexponential.jl")
include("standard/stdlogistic.jl")
include("standard/stdnormal.jl")
include("combinators/half.jl")

include("rand.jl")
include("fixedrng.jl")

include("density.jl")
include("density-core.jl")

include("interface.jl")

include("measure_operators.jl")

using .Interface

end # module MeasureBase
3 changes: 3 additions & 0 deletions src/absolutecontinuity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@
# representative(μ) ≪ representative(ν) && return true
# return false
# end

# ≪(::M, ::WeightedMeasure{R,M}) where {R,M} = true
# ≪(::WeightedMeasure{R,M}, ::M) where {R,M} = true
Loading