fn
psi
→Tensorpsi(x: Tensor)Digamma function .
Convenience alias for lucid.digamma. The digamma function
is the logarithmic derivative of the gamma function and the
fundamental building block of the polygamma family.
Parameters
xTensorInput tensor; any floating-point dtype.
Returns
Tensorelement-wise.
Notes
Definition:
where is the Euler–Mascheroni constant. Used in the derivatives of log-likelihoods of the Gamma / Beta / Dirichlet distributions. Has simple poles at the non-positive integers.
Examples
>>> import lucid
>>> from lucid.special import psi
>>> psi(lucid.tensor([1.0, 2.0, 10.0]))
Tensor([-0.5772, 0.4228, 2.2517])