小编use*_*984的帖子

theano.scan的更新如何运作?

theano.scan返回两个变量:values变量和更新变量.例如,

a = theano.shared(1)

values, updates = theano.scan(fn=lambda a:a+1, outputs_info=a,  n_steps=10)
Run Code Online (Sandbox Code Playgroud)

但是,我注意到在我使用的大多数示例中,updates变量都是空的.似乎只有当我们theano.scan以某种方式编写函数时,我们才会获得更新.例如,

a = theano.shared(1)

values, updates = theano.scan(lambda: {a: a+1}, n_steps=10)
Run Code Online (Sandbox Code Playgroud)

有人可以向我解释为什么在第一个例子中更新是空的,但在第二个例子中,更新变量不为空?更一般地说,更新如何变量theano.scan起作用?谢谢.

python machine-learning theano

11
推荐指数
2
解决办法
2790
查看次数

标签 统计

machine-learning ×1

python ×1

theano ×1