Skip to content

Fix do/conditioning model docs #6936

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

Merged
merged 5 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ API

api/distributions
api/gp
api/model/core
api/model/fgraph
api/model/transform/conditioning
api/model
api/samplers
api/vi
api/smc
Expand Down
11 changes: 11 additions & 0 deletions docs/source/api/model.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Model
------

.. automodule:: pymc.model

.. toctree::
:maxdepth: 2

model/core
model/conditioning
model/fgraph
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@ Model Conditioning
.. autosummary::
:toctree: generated/

change_value_transforms
do
observe

Others
------

.. autosummary::
:toctree: generated/

change_value_transforms
remove_value_transforms
4 changes: 1 addition & 3 deletions docs/source/api/model/core.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
Model
-----

Model creation and inspection
-----------------------------

Expand All @@ -16,6 +13,7 @@ Model creation and inspection
Others
------

.. currentmodule:: pymc.model.core
.. autosummary::
:toctree: generated/

Expand Down
4 changes: 2 additions & 2 deletions pymc/model/transform/conditioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def change_value_transforms(
new_p = untransformed_p['p']
std_q = ((1 / pm.find_hessian(mean_q, vars=[new_p])) ** 0.5)[0]

print(f" Mean, Standard deviation\np {mean_q['p']:.2}, {std_q[0]:.2}")
print(f" Mean, Standard deviation\\np {mean_q['p']:.2}, {std_q[0]:.2}")
# Mean, Standard deviation
# p 0.67, 0.16

Expand Down Expand Up @@ -379,7 +379,7 @@ def remove_value_transforms(
with remove_value_transforms(transformed_m) as untransformed_m:
new_p = untransformed_m["p"]
std_q = ((1 / pm.find_hessian(mean_q, vars=[new_p])) ** 0.5)[0]
print(f" Mean, Standard deviation\np {mean_q['p']:.2}, {std_q[0]:.2}")
print(f" Mean, Standard deviation\\np {mean_q['p']:.2}, {std_q[0]:.2}")

# Mean, Standard deviation
# p 0.67, 0.16
Expand Down