Consider deprecating `DeterministicVariable` in favor of Delta distribtions
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 29
- Forks
- 9
- Avg merge
- 9d 9h
- Merged PRs (30d)
- 8
Description
I think we can use numpyro.distributions.Delta in all cases where we currently use our own DeterministicVariable, which would reduce the complexity of the codebase.
>>> import jax.numpy as jnp
>>> import numpyro
>>> from pyrenew.deterministic import DeterministicVariable
>>>
>>> val = jnp.array([1, 2, 3])
>>> det_var = DeterministicVariable("my var", val)
>>> delta_dist = numpyro.distributions.Delta(val)
>>>
>>> delta_dist.sample(key = None)
Array([1, 2, 3], dtype=int32)
>>> det_var.sample()
Array([1, 2, 3], dtype=int32)
Contributor guide
No contributing guide indexed for this repository
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 locating the implementation and all usages of DeterministicVariable, then compare their behavior with numpyro.distributions.Delta. Check the related tests and package documentation for compatibility requirements; done means the migration or deprecation scope is defined and covered by passing tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100