>
> Oh, let me modifty my example a little bit since in the above example of
> Y(50), when x=0, x<=0 still satisfy. So it should stop since x=0.
>
To see the difference clearer, let's change from the condition x<=0 to x<0.
def subtraction(X):
return (X - 10), theano.scan_module.until(X < 0)
X_init = T.scalar('X_init')
X_sqn, _ = theano.scan(
fn = subtraction,
outputs_info = [X_init],
n_steps = 10,
)
Y = theano.function(
inputs = [Mem_init],
outputs = Mem_sqn,
)
print Y(50), Y(66)
the output is:
[ 40. 30. 20. 10. 0. -10.], [ 56. 46. 36. 26. 16. 6. -4. -14.]
which is strange since in Y(50), x = -10 satisfies x<0 first time. But for
Y(60), x=-4 also satisfies x<0 first time, the scan still keep iterating
another loop for x=-14, why? I can't understand.
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.