提交 a0ae9812 authored 作者: Iban Harlouchet's avatar Iban Harlouchet

numpydoc for theano/scalar/basic_scipy.py

上级 69d69910
...@@ -87,14 +87,18 @@ erfc = Erfc(upgrade_to_float_no_complex, name='erfc') ...@@ -87,14 +87,18 @@ erfc = Erfc(upgrade_to_float_no_complex, name='erfc')
class Erfcx(UnaryScalarOp): class Erfcx(UnaryScalarOp):
""" """
Implements the scaled complementary error function exp(x**2)*erfc(x) in a numerically stable way for large x. This Implements the scaled complementary error function exp(x**2)*erfc(x) in a
is useful for calculating things like log(erfc(x)) = log(erfcx(x)) - x ** 2 without causing underflow. Should only numerically stable way for large x. This is useful for calculating things
be used if x is known to be large and positive, as using erfcx(x) for large negative x may instead introduce like log(erfc(x)) = log(erfcx(x)) - x ** 2 without causing underflow.
overflow problems. Should only be used if x is known to be large and positive, as using
erfcx(x) for large negative x may instead introduce overflow problems.
Note: This op can still be executed on GPU, despite not having c_code. When
Notes
-----
This op can still be executed on GPU, despite not having c_code. When
running on GPU, sandbox.cuda.opt.local_gpu_elemwise_[0,1] replaces this op running on GPU, sandbox.cuda.opt.local_gpu_elemwise_[0,1] replaces this op
with sandbox.cuda.elemwise.ErfcxGPU. with sandbox.cuda.elemwise.ErfcxGPU.
""" """
def impl(self, x): def impl(self, x):
if imported_scipy_special: if imported_scipy_special:
...@@ -124,7 +128,9 @@ class Erfinv(UnaryScalarOp): ...@@ -124,7 +128,9 @@ class Erfinv(UnaryScalarOp):
""" """
Implements the inverse error function. Implements the inverse error function.
Note: This op can still be executed on GPU, despite not having c_code. When Notes
-----
This op can still be executed on GPU, despite not having c_code. When
running on GPU, sandbox.cuda.opt.local_gpu_elemwise_[0,1] replaces this op running on GPU, sandbox.cuda.opt.local_gpu_elemwise_[0,1] replaces this op
with sandbox.cuda.elemwise.ErfinvGPU. with sandbox.cuda.elemwise.ErfinvGPU.
...@@ -237,6 +243,7 @@ gamma = Gamma(upgrade_to_float, name='gamma') ...@@ -237,6 +243,7 @@ gamma = Gamma(upgrade_to_float, name='gamma')
class GammaLn(UnaryScalarOp): class GammaLn(UnaryScalarOp):
""" """
Log gamma function. Log gamma function.
""" """
@staticmethod @staticmethod
def st_impl(x): def st_impl(x):
...@@ -280,6 +287,7 @@ gammaln = GammaLn(upgrade_to_float, name='gammaln') ...@@ -280,6 +287,7 @@ gammaln = GammaLn(upgrade_to_float, name='gammaln')
class Psi(UnaryScalarOp): class Psi(UnaryScalarOp):
""" """
Derivative of log gamma function. Derivative of log gamma function.
""" """
@staticmethod @staticmethod
def st_impl(x): def st_impl(x):
...@@ -360,13 +368,13 @@ psi = Psi(upgrade_to_float, name='psi') ...@@ -360,13 +368,13 @@ psi = Psi(upgrade_to_float, name='psi')
class Chi2SF(BinaryScalarOp): class Chi2SF(BinaryScalarOp):
""" """
Compute (1 - chi2_cdf(x)) Compute (1 - chi2_cdf(x)) ie. chi2 pvalue (chi2 'survival function').
ie. chi2 pvalue (chi2 'survival function')
C code is provided in the Theano_lgpl repository. C code is provided in the Theano_lgpl repository.
This make it faster. This make it faster.
https://github.com/Theano/Theano_lgpl.git https://github.com/Theano/Theano_lgpl.git
""" """
@staticmethod @staticmethod
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论