Re: [theano-users] Update shared variable after scan

2016-11-23 Thread Frédéric Bastien
it should not. If this cause problem, it should raise an error. upd isn't a normal python dict, but a special class that will make sure we don't loose updates and give an error if the user would cause that behavior. On Wed, Nov 23, 2016 at 3:13 PM, Shir Gur wrote: > Will it ruin the update dicta

Re: [theano-users] Update shared variable after scan

2016-11-23 Thread Shir Gur
Will it ruin the update dictation of the scan procedure? On Wednesday, November 23, 2016 at 9:07:53 PM UTC+2, nouiz wrote: > > upd[W] = m > > should work. > > Fred > > On Wed, Nov 23, 2016 at 12:39 PM, Shir Gur > wrote: > >> Hi, >> >> i have my scan function, something like >> >> def _loop(i): >>

Re: [theano-users] Update shared variable after scan

2016-11-23 Thread Frédéric Bastien
upd[W] = m should work. Fred On Wed, Nov 23, 2016 at 12:39 PM, Shir Gur wrote: > Hi, > > i have my scan function, something like > > def _loop(i): > x = something with shared varibale W > return x, {W:x} > > > res, upd = theano.scan(fn=_loop, sequence=T.arange(10)) > > > so after each

[theano-users] Update shared variable after scan

2016-11-23 Thread Shir Gur
Hi, i have my scan function, something like def _loop(i): x = something with shared varibale W return x, {W:x} res, upd = theano.scan(fn=_loop, sequence=T.arange(10)) so after each iteration the scan function updates *W* to be *x*. Now i have the following: m = T.argmx(res) func =

[theano-users] Update shared variable after scan

2016-11-23 Thread Shir Gur
Hi, i have my scan function, something like def _loop(i): x = something with shared varibale W return x, {W:x} res, upd = theano.scan(fn=_loop, sequence=T.arange(10)) so after each iteration the scan function updates *W* to be *x*. Now i have the following: m = T.argmx(res) func =