本文整理汇总了Python中theano.compile.ops.as_op方法的典型用法代码示例。如果您正苦于以下问题:Python ops.as_op方法的具体用法?Python ops.as_op怎么用?Python ops.as_op使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类theano.compile.ops
的用法示例。
在下文中一共展示了ops.as_op方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: actrmodel_latency
# 需要导入模块: from theano.compile import ops [as 别名]
# 或者: from theano.compile.ops import as_op [as 别名]
def actrmodel_latency(lf, le, decay, activation_from_time):
"""
Function running the entire lexical decision task for specific
values of the latency factor, latency exponent and decay parameters.
The activation computed with the specific value of the decay
parameter is also inherited as a separate argument to save expensive
computation time.
The function is wrapped inside the theano @as_op decorator so that
pymc3 / theano can use it as part of the RT likelihood function in the
Bayesian model below.
"""
lex_decision.model_parameters["latency_factor"] = lf
lex_decision.model_parameters["latency_exponent"] = le
lex_decision.model_parameters["decay"] = decay
activation_dict = {x[0]: x[1]
for x in zip(LEMMA_CHUNKS, activation_from_time)}
lex_decision.decmem.activations.update(activation_dict)
sample = run_lex_decision_task()
return np.array(sample)
示例2: test_infer_shape
# 需要导入模块: from theano.compile import ops [as 别名]
# 或者: from theano.compile.ops import as_op [as 别名]
def test_infer_shape(self):
x = tensor.dmatrix()
y = tensor.dmatrix()
# adapt the choice of the next instruction to the op under test
self._compile_and_check([x, y], self.op_class()(x, y),
[numpy.random.rand(5, 6),
numpy.random.rand(5, 6)],
self.op_class)
# as_op exercice