theano.scan()原型为:
theano.scan( fn, sequences=None, outputs_info=None, non_sequences=None, n_steps=None, truncate_gradient=-1, go_backwards=False, mode=None, name=None, profile=False, allow_gc=None, strict=False )
fn:一个函数,要求scan的每一个步骤都需要执行这个函数,可以有多个参数,对应于scan其他几个参数,例,如下调用:
scan(fn, sequences = [ dict(input= Sequence1, taps = [-3,2,-1]), Sequence2, dict(input = Sequence3, taps = 3) ],
outputs_info = [ dict(initial = Output1, taps = [-3,-5]), dict(initial = Output2, taps = None), Output3 ], non_sequences = [ Argument1, Argument2])
fn函数的参数列表为如下顺序, t表示当前迭代:
1. Sequence1[t-3]
2. Sequence1[t+2]
3. Sequence1[t-1]
4. Sequence2[t]
5. Sequence3[t+3]
6. Output1[t-3]
7. Output1[t-5]
8. Output3[t-1]
9. Argument1
10. Argument2
时间: 2024-10-27 18:19:23