bat / BAT.jl

A Bayesian Analysis Toolkit in Julia
Other
198 stars 30 forks source link

Dropped call to deprecated bat_sample(::RNG,..) / non-context #418

Closed waldie11 closed 1 year ago

waldie11 commented 1 year ago

Affects i.e. InitFromSamples

using BAT
using ValueShapes
import HeterogeneousComputing
import Optim
import ForwardDiff

rng = Philox4x()
context = BATContext{Float64}(rng, HeterogeneousComputing.CPUnit(),BAT._NoADSelected() )

posterior = BAT.example_posterior()

r_mh = BAT.bat_sample(posterior)
usamples = unshaped.(r_mh.result)

r_mode = BAT.bat_findmode(posterior, BAT.NelderMeadOpt(init=BAT.InitFromSamples(usamples)),
    context )

r_lbfgs = BAT.bat_findmode(posterior, BAT.LBFGSOpt(init=BAT.InitFromSamples(usamples)),
    BATContext{Float64}(rng, HeterogeneousComputing.CPUnit(),BAT.AutoDiffOperators.forward_ad_selector(BAT.AutoDiffOperators.ADModule(ForwardDiff)) ) )
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 73.33% and project coverage change: +0.17 :tada:

Comparison is base (380e07b) 54.79% compared to head (6e9dea2) 54.96%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #418 +/- ## ========================================== + Coverage 54.79% 54.96% +0.17% ========================================== Files 116 116 Lines 5617 5614 -3 ========================================== + Hits 3078 3086 +8 + Misses 2539 2528 -11 ``` | [Impacted Files](https://app.codecov.io/gh/bat/BAT.jl/pull/418?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bat) | Coverage Δ | | |---|---|---| | [src/initvals/initvals.jl](https://app.codecov.io/gh/bat/BAT.jl/pull/418?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bat#diff-c3JjL2luaXR2YWxzL2luaXR2YWxzLmps) | `59.21% <73.33%> (+11.10%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/bat/BAT.jl/pull/418/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bat)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

oschulz commented 1 year ago

Thanks!