提交 3b760e89 authored 作者: amrithasuresh's avatar amrithasuresh

Updated numpy as np

上级 c7376aba
from __future__ import absolute_import, print_function, division from __future__ import absolute_import, print_function, division
import numpy import numpy as np
from theano.tensor.elemwise import Elemwise from theano.tensor.elemwise import Elemwise
from theano import scalar from theano import scalar
...@@ -15,7 +15,7 @@ class XlogX(scalar.UnaryScalarOp): ...@@ -15,7 +15,7 @@ class XlogX(scalar.UnaryScalarOp):
def st_impl(x): def st_impl(x):
if x == 0.0: if x == 0.0:
return 0.0 return 0.0
return x * numpy.log(x) return x * np.log(x)
def impl(self, x): def impl(self, x):
return XlogX.st_impl(x) return XlogX.st_impl(x)
...@@ -48,7 +48,7 @@ class XlogY0(scalar.BinaryScalarOp): ...@@ -48,7 +48,7 @@ class XlogY0(scalar.BinaryScalarOp):
def st_impl(x, y): def st_impl(x, y):
if x == 0.0: if x == 0.0:
return 0.0 return 0.0
return x * numpy.log(y) return x * np.log(y)
def impl(self, x, y): def impl(self, x, y):
return XlogY0.st_impl(x, y) return XlogY0.st_impl(x, y)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论