Math#
This submodule contains various mathematical functions. Most of them are imported directly from pytensor.tensor (see there for more details). Doing any kind of math with PyMC random variables, or defining custom likelihoods or priors requires you to use these PyTensor expressions rather than NumPy or Python code.
Functions exposed in pymc namespace#
|
Convert a packed triangular matrix into a two dimensional array. |
|
|
Logistic sigmoid function (1 / (1 + exp(-x)), also known as expit or inverse logit |
|
|
|
|
|
|
Compute the log of the sum of exponentials of input elements. |
Functions exposed in pymc.math#
|
Return a symbolic dot product. |
|
Return a TensorConstant with value x. |
|
Return a copy of the array collapsed into one dimension. |
|
equivalent of numpy.zeros_like Parameters ---------- model : tensor dtype : data-type, optional opt : If True, we will return a constant instead of a graph when possible. Useful for PyTensor optimization, not for user building a graph as this have the consequence that model isn't always in the graph. |
|
equivalent of numpy.ones_like Parameters ---------- model : tensor dtype : data-type, optional opt : If True, we will return a constant instead of a graph when possible. Useful for PyTensor optimization, not for user building a graph as this have the consequence that model isn't always in the graph. |
|
Stack tensors in sequence on given axis (default is 0). |
|
|
|
Computes the sum along the given axis(es) of a tensor input. |
|
Computes the product along the given axis(es) of a tensor input. |
a < b |
|
a > b |
|
a <= b |
|
a >= b |
|
a == b |
|
a != b |
|
if cond then ift else iff |
|
Clip x to be between min and max. |
|
if cond then ift else iff |
|
bitwise a & b |
|
bitwise a | b |
|
e^`a` |
|
base e logarithm of a |
|
cosine of a |
|
sine of a |
|
tangent of a |
|
hyperbolic cosine of a |
|
hyperbolic sine of a |
|
hyperbolic tangent of a |
|
square of a |
|
square root of a |
|
error function |
|
inverse error function |
|
|
Return a symbolic dot product. |
elemwise maximum. |
|
elemwise minimum. |
|
|
sign of a |
ceiling of a |
|
floor of a |
|
Generalizes a core Op to work with batched dimensions. |
|
Logistic sigmoid function (1 / (1 + exp(-x)), also known as expit or inverse logit |
|
|
Compute the log of the sum of exponentials of input elements. |
Logistic sigmoid function (1 / (1 + exp(-x)), also known as expit or inverse logit |
|
|