Distribution class refactoring: an example using the Weibull distribution #4668
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses a topic that @brandonwillard brought up in issue 4518 (and 4515) regarding the
Distribution
interface for random variables. I came across these refactoring challenges when learning about the replacement ofrandom
functions torng_fn
.Overall, I'm trying to understand how
Distribution
classes are to be updated, so here is my attempt in which I worked on the Weibull distribution. Following the example code in issue 4518, a summary of what I did (and am understanding) is as follows:weibull = WeibullRV()
fromaesara.tensor.random.basic
mean
,variance
andmode
are removed.Question
RV
objects inaesara.tensor.random.basic
have__call__
andrng_fn
implemented. Should these be implemented? Please let me know if my questions are answered in another thread.Next steps
Distribution
objects incontinuous.py
anddiscrete.py
inpymc3.distributions
rng_fn
class methods in Aesara