prophys.symbolic#
Symbolic expressions: parameters, inputs, operators and elementwise functions.
Every model quantity in prophys is an Expr, a lazily evaluated,
differentiable expression graph. Leaves are constants (Const),
fitted parameters (Param) and data placeholders (Input).
Functions such as exp(), sqrt() or where() combine them
elementwise. The special functions (erf(), ndtr(),
owens_t(), …) are evaluated by optimized native kernels with exact
gradients. The most common names are also exported at the top level
(prp.exp, prp.Param, …).
Classes
A fixed constant leaf holding a Python scalar, NumPy array or JAX array. |
|
Base class of every symbolic expression node. |
|
An expression node that applies a pure function to the values of its child expressions. |
|
A named, learnable leaf fitted by calibration or optimization. |
|
A named placeholder for data supplied at evaluation time. |
|
A learnable on/off design decision that stays differentiable. |
|
A learnable choice among k discrete states that stays differentiable. |
|
Wrap an arbitrary pure callable, compatible with JAX, as a symbolic node. |
Functions
Build an Op node applying a JAX function to expressions. |
|
Return value as an expression, wrapping non-Expr values in a Const. |
|
Elementwise absolute value of an expression (named |
|
Elementwise arctangent of |
|
Elementwise clamp of an expression to the interval |
|
Join expressions along an existing axis. |
|
Elementwise cosine of an expression given in radians. |
|
Elementwise conversion of an angle expression from degrees to radians. |
|
Dot product of two expressions, with |
|
Elementwise exponential |
|
Elementwise natural logarithm of an expression. |
|
Elementwise base-10 logarithm of an expression. |
|
Numerically stable |
|
Elementwise maximum of two broadcastable expressions. |
|
Arithmetic mean of an expression over axis (all elements when |
|
Elementwise minimum of two broadcastable expressions. |
|
Euclidean (L2) norm of an expression along axis (the last axis by default). |
|
Product of an expression over axis (all elements when |
|
Elementwise conversion of an angle expression from radians to degrees. |
|
Elementwise rectified linear unit |
|
Elementwise logistic sigmoid |
|
Elementwise hyperbolic tangent of an expression. |
|
Elementwise sign of an expression: -1, 0 or +1. |
|
Elementwise sine of an expression given in radians. |
|
Smooth, differentiable approximation of the maximum along axis. |
|
Smooth, differentiable approximation of the minimum along axis. |
|
Elementwise softplus |
|
Elementwise square root of an expression. |
|
Stack expressions of the same shape along a new axis. |
|
Sum of an expression over axis (all elements when |
|
Elementwise tangent of an expression given in radians. |
|
Elementwise selection: a where cond is true, otherwise b. |
|
Elementwise error function |
|
Elementwise complementary error function |
|
Elementwise scaled complementary error function |
|
Elementwise standard normal cumulative distribution function |
|
Elementwise logarithm of the standard normal CDF, |
|
Elementwise exponential integral |
|
Elementwise exponentially scaled modified Bessel function of the first kind, |
|
Elementwise exponentially scaled modified Bessel function of the first kind, |
|
Elementwise scaled modified Bessel function of the second kind, |
|
Elementwise scaled modified Bessel function of the second kind, |
|
Elementwise Owen's T function |
Exceptions
Raised when shapes are incompatible, such as a distribution's sample shape and its parameters' batch shape. |
Constants and objects