TuringLang / TuringLang/DynamicPPL.jl
Drop `.~` syntax entirely
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 286
- Forks
- 41
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 34
Description
The .~ syntax allows one to define parameters in a vectorised manner:
x = Vector(undef, 4)
x .~ Distribution()
https://github.com/TuringLang/DynamicPPL.jl/pull/804 introduced extra constraints on the RHS: it has to be univariate distributions. This makes the need for the broadcasting syntax . questionable: it is much less flexible than Julia's broadcasting. So, using the broadcasting .~ might be confusing actually. I think we should further simplify vectorised tilde into
x = Vector(undef, 4)
x ~ UnivariateDistribution()
This is semantically equivalent to x ~ filldist(UnivariateDistribution(), 4) but with a cleaner syntax. It also provides a clean syntax for supporting (univariate) identically-independently-distributed (IID) distributions discussed previously.
This proposal is also consistent with the Stan syntax for vectorised random variables.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading PR #804 and locating the implementation and tests for the .~ syntax. Determine the affected handling of vectorised tilde expressions, then update the behavior so the proposed x ~ UnivariateDistribution() form replaces .~; done means the old syntax is removed and the new syntax is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- machine-learning
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100