提交 5698befd authored 作者: amrithasuresh's avatar amrithasuresh

Updated numpy as np

上级 b17f6ef6
...@@ -2,7 +2,7 @@ from __future__ import absolute_import, print_function, division ...@@ -2,7 +2,7 @@ from __future__ import absolute_import, print_function, division
# Definitions of theano.scalar ops that have their python implementation taken # Definitions of theano.scalar ops that have their python implementation taken
# from SciPy. As SciPy is not always available, we treat them separately. # from SciPy. As SciPy is not always available, we treat them separately.
import numpy import numpy as np
import theano import theano
from theano.gradient import grad_not_implemented from theano.gradient import grad_not_implemented
...@@ -43,7 +43,7 @@ class Erf(UnaryScalarOp): ...@@ -43,7 +43,7 @@ class Erf(UnaryScalarOp):
else: else:
return [x.zeros_like()] return [x.zeros_like()]
cst = numpy.asarray(2. / numpy.sqrt(numpy.pi), cst = np.asarray(2. / np.sqrt(np.pi),
dtype=upcast(x.type.dtype, gz.type.dtype)) dtype=upcast(x.type.dtype, gz.type.dtype))
return gz * cst * exp(-x * x), return gz * cst * exp(-x * x),
...@@ -74,7 +74,7 @@ class Erfc(UnaryScalarOp): ...@@ -74,7 +74,7 @@ class Erfc(UnaryScalarOp):
else: else:
return [x.zeros_like()] return [x.zeros_like()]
cst = numpy.asarray(2. / numpy.sqrt(numpy.pi), cst = np.asarray(2. / np.sqrt(np.pi),
dtype=upcast(x.type.dtype, gz.type.dtype)) dtype=upcast(x.type.dtype, gz.type.dtype))
return - gz * cst * exp(-x * x), return - gz * cst * exp(-x * x),
...@@ -120,7 +120,7 @@ class Erfcx(UnaryScalarOp): ...@@ -120,7 +120,7 @@ class Erfcx(UnaryScalarOp):
else: else:
return [x.zeros_like()] return [x.zeros_like()]
cst = numpy.asarray(2. / numpy.sqrt(numpy.pi), cst = np.asarray(2. / np.sqrt(np.pi),
dtype=upcast(x.type.dtype, gz.type.dtype)) dtype=upcast(x.type.dtype, gz.type.dtype))
return gz * (-cst + (2. * x) * erfcx(x)), return gz * (-cst + (2. * x) * erfcx(x)),
...@@ -155,7 +155,7 @@ class Erfinv(UnaryScalarOp): ...@@ -155,7 +155,7 @@ class Erfinv(UnaryScalarOp):
else: else:
return [x.zeros_like()] return [x.zeros_like()]
cst = numpy.asarray(numpy.sqrt(numpy.pi) / 2., cst = np.asarray(np.sqrt(np.pi) / 2.,
dtype=upcast(x.type.dtype, gz.type.dtype)) dtype=upcast(x.type.dtype, gz.type.dtype))
return gz * cst * exp(erfinv(x) ** 2), return gz * cst * exp(erfinv(x) ** 2),
...@@ -188,7 +188,7 @@ class Erfcinv(UnaryScalarOp): ...@@ -188,7 +188,7 @@ class Erfcinv(UnaryScalarOp):
else: else:
return [x.zeros_like()] return [x.zeros_like()]
cst = numpy.asarray(numpy.sqrt(numpy.pi) / 2., cst = np.asarray(np.sqrt(np.pi) / 2.,
dtype=upcast(x.type.dtype, gz.type.dtype)) dtype=upcast(x.type.dtype, gz.type.dtype))
return - gz * cst * exp(erfcinv(x) ** 2), return - gz * cst * exp(erfcinv(x) ** 2),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论