Skip to content

Commit

Permalink
Manually fix some pyupgrade changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aseyboldt committed Sep 16, 2020
1 parent f8e3dc3 commit 4f4e92c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pymc3/distributions/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(
epsilon=1,
**kwargs,
):
"""
r"""
This class stores a function defined by the user in Python language.
function: function
Expand All @@ -43,9 +43,9 @@ def __init__(
Distance functions. Available options are "gaussian_kernel" (default), "wasserstein",
"energy" or a user defined function that takes epsilon (a scalar), and the summary
statistics of observed_data, and simulated_data as input.
``gaussian_kernel`` :math: `\\sum \\left(-0.5 \\left(\frac{xo - xs}{\\epsilon}\right)^2\right)`
``wasserstein`` :math: `\frac{1}{n} \\sum{\\left(\frac{|xo - xs|}{\\epsilon}\right)}`
``energy`` :math: `\\sqrt{2} \\sqrt{\frac{1}{n} \\sum \\left(\frac{|xo - xs|}{\\epsilon}\right)^2}`
``gaussian_kernel`` :math: `\sum \left(-0.5 \left(\frac{xo - xs}{\epsilon}\right)^2\right)`
``wasserstein`` :math: `\frac{1}{n} \sum{\left(\frac{|xo - xs|}{\epsilon}\right)}`
``energy`` :math: `\sqrt{2} \sqrt{\frac{1}{n} \sum \left(\frac{|xo - xs|}{\epsilon}\right)^2}`
For the wasserstein and energy distances the observed data xo and simulated data xs
are internally sorted (i.e. the sum_stat is "sort").
sum_stat: str or callable
Expand Down
2 changes: 1 addition & 1 deletion pymc3/step_methods/hmc/quadpotential.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ def update(self, sample, grad, tune):

def raise_ok(self, vmap):
if self._chol_error is not None:
raise ValueError(f"{self._chol_error}")
raise ValueError(str(self._chol_error))


class _WeightedCovariance:
Expand Down

0 comments on commit 4f4e92c

Please sign in to comment.