theano.scan
return two variables: values variable and updates variable. For example,
a = theano.shared(1)
values, updates = theano.scan(fn=lambda a:a+1, outputs_info=a, n_steps=10)
However, I notice that in most of the examples I work with, the updates variable is empty. It seems only when we write the function in theano.scan
is a certain way, we get the updates. For example,
a = theano.shared(1)
values, updates = theano.scan(lambda: {a: a+1}, n_steps=10)
Can someone explain to me why in the first example the updates is empty, but in the second example, the updates variable is not empty? and more generally, how does the updates variable in theano.scan
work? Thanks.