Skip to content

Commit afbb2e9

Browse files
authored
Dev (#204)
* 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 * export likelihood * Snedecor's F * Gamma distribution * more gamma stuff * Beroulli() * inverse Gaussian * Getting modifed GLM.jl tests to pass * drop pdf and logpdf * Poisson bugfix * update Normal(μ, σ²) * Gamma(μ, ϕ) for GLMs * updates for GLM support * start on truncated * update parameterized measures * drop FactoredBase * drop old LazyArrays dependency * insupport(::Distribution) * Left out"Dists." * don't export `ifelse` (#192) * Kleisli => TransitionKernel * depend on StatsBase * tests passing * bump MeasureBase version * work on truncated and censored * improve func_string * Simplify logdensity_def(::For, x) * Move truncated and censored updates to separate branches * newline * comment out in-progress stuff * newline * bump version * update formatting spec * more formatting * tweedie docs * drop redundant exports * update exports * omega => lambda * drop SequentialEx * get tests passing * add kernel tests * gitignore * better `Pretty.tile` for Affine and AffineTransforms * formatting * kleisli => kernel * update tile(::For) * update Compat version * bump MB version * update gamma * Let's come back to InverseGaussian * CI on 1.7 * update IfElse * formatting * update product * @kwstruct Bernoulli(logitp) * Base.size(r::RealizedSamples)
1 parent 50d90d7 commit afbb2e9

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/combinators/product.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ function as(d::PowerMeasure)
33
end
44

55
function as(d::ProductMeasure{A}) where {A<:AbstractArray}
6+
mar = marginals(d)
7+
ts = map(as, mar)
8+
if allequal(ts)
9+
return as(Array, first(ts), size(ts))
10+
else
11+
error("Not yet implemented")
12+
end
13+
end
14+
15+
using MappedArrays
16+
17+
function as(d::ProductMeasure{A}) where {A<:MappedArrays.ReadonlyMappedArray}
618
d1 = marginals(d).f(first(marginals(d).data))
719
as(Array, as(d1), size(marginals(d))...)
820
end

src/parameterized/bernoulli.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import Base
99

1010
@kwstruct Bernoulli(p)
1111

12+
@kwstruct Bernoulli(logitp)
13+
1214
Bernoulli(p) = Bernoulli((p = p,))
1315

1416
basemeasure(::Bernoulli) = CountingMeasure()

src/realized.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ RealizedSamples(rng::AbstractRNG, iter) = RealizedSamples(Realized(rng, iter))
121121

122122
Base.show(io::IO, r::RealizedSamples) = Pretty.pprint(io, r)
123123

124+
Base.size(r::RealizedSamples) = size(r.parent)
125+
124126
function Pretty.quoteof(r::RealizedSamples)
125127
:(RealizedSamples($(Pretty.quoteof(r.parent.rng)), $(Pretty.quoteof(r.parent.iter))))
126128
end

0 commit comments

Comments
 (0)