本文整理汇总了Python中theano.scalar.basic.exp函数的典型用法代码示例。如果您正苦于以下问题:Python exp函数的具体用法?Python exp怎么用?Python exp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了exp函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: grad
def grad(self, inp, grads):
"""
"""
x, = inp
gz, = grads
cst = numpy.asarray(-2. / numpy.sqrt(numpy.pi),
dtype=upcast(x.type.dtype, gz.type.dtype))
return gz * (cst + 2. * x * exp(-x * x) * erfcx(x)),
示例2: grad
def grad(self, inp, grads):
x, = inp
gz, = grads
if x.type in complex_types:
raise NotImplementedError()
elif x.type in float_types:
cst = numpy.asarray(numpy.sqrt(numpy.pi) / 2.0, dtype=upcast(x.type.dtype, gz.type.dtype))
return (gz * cst * exp(erfinv(x) ** 2),)
else:
return (None,)
示例3: grad
def grad(self, inp, grads):
x, = inp
gz, = grads
if x.type in complex_types:
raise NotImplementedError()
elif x.type in float_types:
cst = numpy.asarray(2. / numpy.sqrt(numpy.pi),dtype=upcast(x.type.dtype,gz.type.dtype))
return - gz * cst * exp(-x*x),
else:
return None,
示例4: grad
def grad(self, inp, grads):
x, = inp
gz, = grads
if x.type in complex_types:
raise NotImplementedError()
if self(x).type in discrete_types:
if x.type in discrete_types:
return [x.zeros_like(dtype=theano.config.floatX)]
else:
return [x.zeros_like()]
cst = numpy.asarray(2.0 / numpy.sqrt(numpy.pi), dtype=upcast(x.type.dtype, gz.type.dtype))
return (-gz * cst * exp(-x * x),)
示例5: L_op
def L_op(self, inputs, outputs, grads):
x, = inputs
gz, = grads
if x.type in complex_types:
raise NotImplementedError()
if outputs[0].type in discrete_types:
if x.type in discrete_types:
return [x.zeros_like(dtype=theano.config.floatX)]
else:
return [x.zeros_like()]
cst = np.asarray(2. / np.sqrt(np.pi),
dtype=upcast(x.type.dtype, gz.type.dtype))
return - gz * cst * exp(-x * x),
示例6: L_op
def L_op(self, inputs, outputs, grads):
x, = inputs
gz, = grads
if x.type in complex_types:
raise NotImplementedError()
if outputs[0].type in discrete_types:
if x.type in discrete_types:
return [x.zeros_like(dtype=theano.config.floatX)]
else:
return [x.zeros_like()]
cst = numpy.asarray(numpy.sqrt(numpy.pi) / 2.,
dtype=upcast(x.type.dtype, gz.type.dtype))
return gz * cst * exp(erfinv(x) ** 2),