- A ``map()`` operation can be performed by applying a function that
- A ``map()`` operation can be performed by applying a function that
ignores each previous output.
ignores each previous output.
Often a for loop can be expressed as a ``scan()`` operation, and ``scan`` is the closest that theano comes to looping. The advantage of using ``scan`` over
Often a for loop can be expressed as a ``scan()`` operation, and ``scan`` is
for loops is that it allows you to express the loop symbolically. The
the closest that theano comes to looping. The advantage of using ``scan``
over for loops is that it allows you to express the loop symbolically. The
Scan Op should always be used by applying the ``scan`` function.
Scan Op should always be used by applying the ``scan`` function.
"""
"""
__docformat__='restructedtext en'
__docformat__='restructedtext en'
...
@@ -299,7 +300,7 @@ class Scan(theano.Op):
...
@@ -299,7 +300,7 @@ class Scan(theano.Op):
self.destroy_map={}
self.destroy_map={}
ifinplace:
ifinplace:
foriininplace_map.keys():
foriininplace_map.keys():
self.destroy_map.update({i:[inplace_map[i]]})
self.destroy_map.update({i:[inplace_map[i]+1]})
self.seqs_taps=seqs_taps
self.seqs_taps=seqs_taps
self.outs_taps=outs_taps
self.outs_taps=outs_taps
...
@@ -373,8 +374,6 @@ class Scan(theano.Op):
...
@@ -373,8 +374,6 @@ class Scan(theano.Op):
rval=(self.inputs==other.inputs)and \
rval=(self.inputs==other.inputs)and \
(self.outputs==other.outputs)and \
(self.outputs==other.outputs)and \
(self.keep_outputs==other.keep_outputs)and \
(self.keep_outputs==other.keep_outputs)and \
(self.g_ins==other.g_ins)and \
(self.g_outs==other.g_outs)and \
(self.seqs_taps==other.seqs_taps)and \
(self.seqs_taps==other.seqs_taps)and \
(self.outs_taps==other.outs_taps)and \
(self.outs_taps==other.outs_taps)and \
(self.inplace_map==other.inplace_map)and \
(self.inplace_map==other.inplace_map)and \
...
@@ -553,6 +552,9 @@ class Scan(theano.Op):
...
@@ -553,6 +552,9 @@ class Scan(theano.Op):
defgrad(self,args,g_outs):
defgrad(self,args,g_outs):
raiseNotImplemented;
'''
if True:
if True:
#((self.updates.keys() != []) or (self.inplace_map.keys() != [])\
#((self.updates.keys() != []) or (self.inplace_map.keys() != [])\