-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Dirichlet(k::Integer, α) = Dirichlet(Fill(α, k)) * export TransformVariables as TV * drop redundant import * 0.0 => zero(Float64) * drop outdated Dists.logpdf * update StudentT * drop redundant import * update Uniform * bump MeasureBase version * reworking beta * small update to StudentT * basemeasure for discrete Distributions * using LogExpFunctions => import LogExpFunctions * quoteof(::Chain) * prettyprinting and chain-mucking * Some refactoring for Markov chains * import MeasureBase: ≪ * version bound for PrettyPrinting * copy(rng) might change its type (e.g. GLOBAL_RNG) * tests pass * cleaning up * more cleanup * big update * get tests passing * formatting * oops typo * move affine to MeasureTheory * updating * Val => StaticSymbol * more fixes * fix fix fix * more logdesnity => logdensity_def * more logdesnity fixes * debugging * formatting * bugfixes * working on tests * updates * working on tests * tests passing! * refactor * working on tests * drop static weight for now * fix sampling from ProductMeasure{<:Base.Generator} * tests passing!! * more stuff * constructor => constructorof * constructor =? construtorof * updates * working on tests * fix Dirichlet * update Bernoulli * working on tests * bugfixes for RealizedSamples * tests passing!! * tighten down inference * as(::PowerMeasure) * drop type-level stuff * using InverseFunctions.jl * update license * affero * copyright * update CI to 1.6 * xform => TV.as * oops missed a conflict * fix merge corruption * typo * fix license * Update README.md * merge * enumerate instead of zip * bugfix * inline rand * drop `static` from `insupport` results * update proxies * Move ConditionalMeasure to MeasureBase * IfElse.ifelse(p::Bernoulli, t, f) * IfElseMeasure * update some base measures * test broken :( * fix some redundancies * instance_type => Core.Typeof * update testvalue for Bernoulli and Binomial * un-break broken test (now passing) * Fall-back `For` method for when inference fails * drop extra spaces * more whitespace * bump MeasureBase dependency version * add newline * tidy up * ifelse tests * OEF newline * avoid type piracy * add Julia 1.7 to CI * make Julia 1.6 happy * approx instead of == * Require at least Julia 1.6 * Try Sebastian's idea test_measures ::Any[] * Another Any[] * Drop Likelihood test * drop 1.7 CI (seems buggy?) * bump version
- Loading branch information
Showing
32 changed files
with
133 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,6 @@ jobs: | |
matrix: | ||
version: | ||
- '1.6' | ||
- '1' | ||
os: | ||
- ubuntu-latest | ||
- macOS-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020-2021 Chad Scherrer <[email protected]> and contributors | ||
Copyright (c) 2020-2022 Chad Scherrer <[email protected]> and contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "MeasureTheory" | ||
uuid = "eadaa1a4-d27c-401d-8699-e962e1bbc33b" | ||
authors = ["Chad Scherrer <[email protected]> and contributors"] | ||
version = "0.14.0" | ||
version = "0.15.0" | ||
|
||
[deps] | ||
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" | ||
|
@@ -14,6 +14,7 @@ Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" | |
DynamicIterators = "6c76993d-992e-5bf1-9e63-34920a5a5a38" | ||
FLoops = "cc61a311-1640-44b5-9fba-1b764f453329" | ||
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b" | ||
IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" | ||
Infinities = "e1ba4f0e-776d-440f-acd9-e1d2e9742647" | ||
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" | ||
InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" | ||
|
@@ -49,6 +50,7 @@ Distributions = "0.25" | |
DynamicIterators = "0.4" | ||
FLoops = "0.2" | ||
FillArrays = "0.12, 0.13" | ||
IfElse = "0.1" | ||
Infinities = "0.1" | ||
InverseFunctions = "0.1" | ||
KeywordCalls = "0.2" | ||
|
@@ -57,7 +59,7 @@ LogExpFunctions = "0.3.3" | |
MLStyle = "0.4" | ||
MacroTools = "0.5" | ||
MappedArrays = "0.4" | ||
MeasureBase = "0.6" | ||
MeasureBase = "0.7" | ||
NamedTupleTools = "0.13, 0.14" | ||
NestedTuples = "0.3" | ||
PositiveFactorizations = "0.2" | ||
|
@@ -69,7 +71,7 @@ StaticArrays = "1.3" | |
StatsFuns = "0.9" | ||
TransformVariables = "0.5, 0.6" | ||
Tricks = "0.1" | ||
julia = "1.5" | ||
julia = "1.6" | ||
|
||
[extras] | ||
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -291,4 +291,4 @@ end | |
|
||
@inline function insupport(d::Affine, x) | ||
insupport(d.parent, inverse(d.f)(x)) | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
struct IfElseMeasure{B,T,F} <: AbstractMeasure | ||
b::B | ||
t::T | ||
f::F | ||
end | ||
|
||
insupport(d::IfElseMeasure, x) = insupport(d.t, x) || insupport(d.f, x) | ||
|
||
function logdensity_def(d::IfElseMeasure, x) | ||
p = mean(d.b) | ||
logdensity_def(p * d.t + (1 - p) * d.f, x) | ||
end | ||
|
||
basemeasure(d::IfElseMeasure) = d.t + d.f | ||
|
||
@inline function Base.rand(rng::AbstractRNG, ::Type{T}, m::IfElseMeasure) where {T} | ||
c = rand(rng, T, m.b) | ||
result = ifelse(c, m.t, m.f) | ||
rand(rng, T, result) | ||
end | ||
|
||
IfElse.ifelse(b::Bernoulli, t, f) = IfElseMeasure(b, t, f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
|
||
xform(μ::AbstractWeightedMeasure) = xform(μ.base) | ||
TV.as(μ::AbstractWeightedMeasure) = TV.as(μ.base) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
7cda008
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
7cda008
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/58609
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: