当前位置: 首页>>代码示例>>Python>>正文


Python ops.as_op方法代码示例

本文整理汇总了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) 
开发者ID:jakdot,项目名称:pyactr,代码行数:21,代码来源:ch7_lexical_decision_pyactr_with_imaginal_delay_0.py

示例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 
开发者ID:muhanzhang,项目名称:D-VAE,代码行数:15,代码来源:extending_theano_solution_1.py


注:本文中的theano.compile.ops.as_op方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。