TuringLang / DynamicPPL.jl

Implementation of domain-specific language (DSL) for dynamic probabilistic programming
https://turinglang.org/DynamicPPL.jl/
MIT License
157 stars 26 forks source link

Allowing using `NamedTuple` as `initial_params` #632

Closed torfjelde closed 1 month ago

torfjelde commented 2 months ago

Ref: https://github.com/TuringLang/Turing.jl/issues/2286

Quick and dirty implementation, but does the trick.

I probably shouldn't spend much time on this (have other PRs that I need to complete), but figured I'd just add this here in case someone else wants to complete it (maybe @sunxd3 or @mhauru has time) :)

Basically, it's just missing:

sunxd3 commented 2 months ago

Looks reasonable, maybe we can just move update_values!! to out into utils.jl. Regardless, I can write some tests for this.

Can I get your permission to just commit to this PR? @torfjelde

torfjelde commented 2 months ago

Looks reasonable, maybe we can just move update_values!! to out into utils.jl.

Indeed:)

Can I get your permission to just commit to this PR? @torfjelde

Yep, go for it!

coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 10038614257

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/sampler.jl 16 17 94.12%
src/varinfo.jl 0 3 0.0%
<!-- Total: 20 24 83.33% -->
Files with Coverage Reduction New Missed Lines %
src/model.jl 1 87.0%
src/threadsafe.jl 12 45.19%
<!-- Total: 13 -->
Totals Coverage Status
Change from base Build 10038508405: -0.05%
Covered Lines: 2811
Relevant Lines: 3455

💛 - Coveralls
torfjelde commented 1 month ago

LGTM:) Unfortunately I seems I can't approve because I'm the creator of the PR 🙃

sunxd3 commented 1 month ago

wait till https://github.com/TuringLang/DynamicPPL.jl/pull/626 to merge, then I'll fix the versioning and potential errors

sunxd3 commented 1 month ago

Do we need to make this breaking? If not, we can combine the release with https://github.com/TuringLang/DynamicPPL.jl/pull/626