all:
   I want to iterate rows of matrix,and compute based on current row 
,previous output( with taps =[-2,-1]).when running,the output is right but 
some errors also raise:

ERROR (theano.gof.opt): SeqOptimizer apply 
<theano.gof.opt.EquilibriumOptimizer object at 0x7f67b8fbb350>
ERROR (theano.gof.opt): Traceback:
ERROR (theano.gof.opt): Traceback (most recent call last):
  File 
"/usr/local/lib/python2.7/dist-packages/Theano-0.8.2-py2.7.egg/theano/gof/opt.py",
 
line 230, in apply
    sub_prof = optimizer.optimize(fgraph)
  File 
"/usr/local/lib/python2.7/dist-packages/Theano-0.8.2-py2.7.egg/theano/gof/opt.py",
 
line 89, in optimize
    ret = self.apply(fgraph, *args, **kwargs)
  File 
"/usr/local/lib/python2.7/dist-packages/Theano-0.8.2-py2.7.egg/theano/gof/opt.py",
 
line 2144, in apply
    sub_prof = gopt.apply(fgraph)
  File 
"/usr/local/lib/python2.7/dist-packages/Theano-0.8.2-py2.7.egg/theano/scan_module/scan_opt.py",
 
line 1631, in apply
    self.process_node(fgraph, node)
  File 
"/usr/local/lib/python2.7/dist-packages/Theano-0.8.2-py2.7.egg/theano/scan_module/scan_opt.py",
 
line 1446, in process_node
    nw_input = scan_utils.expand_empty(_nw_input, tmp)
  File 
"/usr/local/lib/python2.7/dist-packages/Theano-0.8.2-py2.7.egg/theano/scan_module/scan_utils.py",
 
line 620, in expand_empty
    new_shape = [size + shapes[0]] + shapes[1:]
IndexError: list index out of range


there is the code :
 
import theano
import theano.tensor as T
import numpy as np

X=T.fmatrix()

x=np.arange(12).reshape(6,2)
    
  
result_lag_two_other,updates=theano.scan(lambda x,x2,x1:x+x2+x1,  # 
@UnusedVariable
                                                                
 sequences=X,
                                                                
 outputs_info=dict(initial=T.zeros((2,X.shape[1])),taps=[-2,-1]),
                                                                
 truncate_gradient=-1
                                                                 )
func_lag_two_other=theano.function([X],result_lag_two_other,allow_input_downcast=True,on_unused_input=u'ignore')
    
t_lag_two_other=func_lag_two_other(x)
print t_lag_two_other

-- 

--- 
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.

Reply via email to