码迷,mamicode.com
首页 > 其他好文 > 详细

关于thenao.scan() fn函数参数的说明

时间:2016-04-20 18:03:12      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:

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

关于thenao.scan() fn函数参数的说明

标签:

原文地址:http://www.cnblogs.com/zhuangliu/p/5413543.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!