-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get the transform docs into the API pages. #3690
Merged
Merged
Changes from 2 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
eec41a9
Extend exports from transforms.
rpgoldman e657790
Add docs for distributions.transforms.
rpgoldman b9cbc93
Improve documentation of transform aliases.
rpgoldman 859dac5
Export improvements requested by @ColCarroll.
rpgoldman 75f4f58
Minor edits to clarify transformations.
rpgoldman 76da1b4
Added API page for random variables.
rpgoldman 62a7e1a
Fix typo @twiecki caught and some others.
rpgoldman e8dfa94
Add to release notes.
rpgoldman 4cfa494
Fix typesetting of parameters.
rpgoldman 4220414
Add docstring for t_stick_breaking()
rpgoldman 879fa5d
Slightly improved Table of Contents.
rpgoldman 0556809
Fix formatting of additional parameters.
rpgoldman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
******************************************* | ||
Transformations of a random variable from one space to another. | ||
******************************************* | ||
|
||
.. currentmodule:: pymc3.distributions.transforms | ||
.. autosummary:: | ||
|
||
transform | ||
stick_breaking | ||
logodds | ||
interval | ||
log_exp_m1 | ||
lowerbound | ||
upperbound | ||
ordered | ||
log | ||
sum_to_1 | ||
t_stick_breaking | ||
circular | ||
CholeskyCovPacked | ||
Chain | ||
|
||
Transform Instances | ||
~~~~~~~~~~~~~~~~~~~ | ||
|
||
Transform instances are the entities that should be used in the | ||
`transform` parameter to a random variable constructor. These are | ||
initialized instances of the Transform Classes, which are described | ||
below. | ||
|
||
.. autodata:: stick_breaking | ||
.. autodata:: logodds | ||
.. autodata:: interval | ||
.. autodata:: log_exp_m1 | ||
.. autodata:: lowerbound | ||
.. autodata:: upperbound | ||
.. autodata:: ordered | ||
.. autodata:: log | ||
.. autodata:: sum_to_1 | ||
.. autodata:: t_stick_breaking | ||
.. autodata:: circular | ||
|
||
Transform Base Classes | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Typically the programmer will not use these directly. | ||
|
||
.. autoclass:: Transform | ||
:members: | ||
.. autoclass:: transform | ||
:members: | ||
.. autoclass:: TransformedDistribution | ||
:members: | ||
|
||
|
||
Transform Composition Classes | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. autoclass:: Chain | ||
:members: | ||
.. autoclass:: CholeskyCovPacked | ||
|
||
|
||
Specific Transform Classes | ||
~~~~~~~~~~~~~~~~~ | ||
|
||
.. autoclass:: Log | ||
:members: | ||
.. autoclass:: LogExpM1 | ||
:members: | ||
.. autoclass:: LogOdds | ||
:members: | ||
.. autoclass:: Interval | ||
:members: | ||
.. autoclass:: LowerBound | ||
:members: | ||
.. autoclass:: UpperBound | ||
:members: | ||
.. autoclass:: Ordered | ||
:members: | ||
.. autoclass:: SumTo1 | ||
:members: | ||
.. autoclass:: StickBreaking | ||
:members: | ||
.. autoclass:: Circular | ||
:members: | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this better than the current method. Two things:
pm.distributions.transform
will no longer work. I bet this messes up 0 people, but we should add a deprecation warning before removing.pm.transforms
, so that you could usepm.transforms.ordered()
instead ofpm.distributions.ordered()
(In fact, I think right nowpm.log
might be a transform, and not a logarithm?). I think we would do this by not importing anything from.transforms
here, but in the top level init,import .distributions.transforms as transforms
. How does that sound?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WRT your (1), I think we could just not export
transform
, since it's just an alias forTransform
. That's also theoretically a breaking change, but seems even less likely to cause troubles. Especially since one should not usetransform
as the name of a class in python.(2) Sounds good to me.
LMK what you think about my responses and I will make the changes in the PR, or I believe you could do them yourself, if that's what you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both of those sound good to me. Feel free to ping after you mess with those imports I'll kick the tires locally (and add tests if I find anything :) ) and then merge. Ooh, I'll check the doc thing you just mentioned, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait -- why is
pm.distributions.transform
no longer going to work? It's in the__all__
list intransforms.py
, so I think it's still ok, isn't it?But I like the idea of deprecating it, since for a class
Transform
is preferable. Alsotransform
, not being an initialized entity, doesn't serve the same purpose as the other lower-case names.