【发布时间】:2016-11-20 03:29:29
【问题描述】:
我从http://deeplearning.net/software/theano/library/scan.html获取了以下代码
import numpy
coefficients = theano.tensor.vector("coefficients")
x = T.scalar("x")
max_coefficients_supported = 10000
# Generate the components of the polynomial
components, updates = theano.scan(fn=lambda coefficient, power, free_variable: coefficient * (free_variable ** power),
outputs_info=None,
sequences=[coefficients, theano.tensor.arange(max_coefficients_supported)],
non_sequences=x)
这里的代码是为了解释“sequences”参数。 这是我的问题:
-
如何输入序列?第一项“系数”是张量变量。第二项“theano.tensor.arange(max_coefficients)”是一个张量变量,在使用 eval() 时会给出一个 [0......999] 的列表。教程说-
"The tensor(s) to be looped over should be provided to scan using the sequence keyword argument."根据“序列”中提供的参数,这里的循环是如何发生的?
【问题讨论】:
标签: python-2.7 theano theano.scan