Discussion:
[theano-users] theano scan inner function arguments and huge list for taps in sequences and outputs_info
Caroline Etienne
2018-04-11 12:17:41 UTC
Permalink
Hello,

I would like to have one variable representing the huge list of
TensorVariable provided with dic_in and dic_out. But I don't manage to do
that with the inner function of theano scan.

def inner_function(dic_in, dic_out, *args):
input_t0, input_t1, input_t2 = dic_in
cell_tm1, cell_tm2, cell_tm3 = dic_out


and not

def inner_function(input_t0, input_t1, input_t2, cell_tm1, cell_tm2,
cell_tm3, *args):



nb_time_steps = 3
jump_step = 1
step_list_in = [i for i in range(0, nb_time_steps, jump_step)]
step_list_out = [i for i in range(-nb_time_steps, 0, jump_step)]


dic_in = {'input': sequences, 'taps': step_list_in}
dic_out = {'initial': cell_init, 'taps': step_list_out}
non_seqs =

results, updates = theano.scan(fn=inner_function, sequences = [dic_in],
outputs_info = [dic_out],
go_backwards=self.backwards,
truncate_gradient=self.gradient_steps,
non_sequences = non_seqs, strict=True)[0]


Would someone have some ideas ?

Thank you !
--
---
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 theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Pascal Lamblin
2018-04-11 17:00:05 UTC
Permalink
That's not really possible unfortunately, in particular because each
sequence and intermediate output needs to be a tensor (so the
concatenation is a tensor with 1 more dimension).
Post by Caroline Etienne
Hello,
I would like to have one variable representing the huge list of
TensorVariable provided with dic_in and dic_out. But I don't manage to
do that with the inner function of theano scan.
|
||def|inner_function(dic_in, dic_out, *args)|||:|
| ||||||||||||||||input_t0, input_t1, input_t2 = ||||||dic_in||||
||||||||||||||     cell_tm1, cell_tm2, cell_tm3 =
||||||dic_out||||||||||||||
|
||||||||
|and not
|
|||def|inner_function(input_t0, input_t1, input_t2, cell_tm1, cell_tm2,
cell_tm3, *args):||||
|
|
|
||||||||nb_time_steps =3
jump_step =1
step_list_in =[i fori inrange(0,nb_time_steps,jump_step)]
step_list_out =[i fori inrange(-nb_time_steps,0,jump_step)]
dic_in ={'input':sequences,'taps':step_list_in}
dic_out ={'initial':cell_init,'taps':step_list_out}
|non_seqs| =
results, updates=theano.scan(fn=inner_function,sequences
=[dic_in], outputs_info =[dic_out],
go_backwards=self.backwards,truncate_gradient=self.gradient_steps,
                                  non_sequences =non_seqs,strict=True)[0]
|
Would someone have some ideas ?
Thank you !
--
---
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
For more options, visit https://groups.google.com/d/optout.
--
Pascal Lamblin
--
---
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 theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Caroline Etienne
2018-04-11 17:29:28 UTC
Permalink
Ok thank you for your answer Pascal !
--
---
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 theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...