lstm_seqlabel_circuit_order_one_crf_decode_and_partition.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:neural_wfst 作者: se4u 项目源码 文件源码
def retrieve_path_from_backpointers(bp, starting_point):
    '''
    Theano scan loop to follow backpointers, starting from a given spot.
    Params
    ------
    bp             : The trail of backpointers. Think of this is as a list of
        lists where we start from the back `bp = list[N][starting_point]` and
        then go to list[N-1][bp] and so on.
    starting_point :
    '''
    vp_prefix = th_reverse(
        theano.scan(
            lambda p, y: p[y],
            sequences=bp,
            outputs_info=starting_point,
            go_backwards=True,
            name='OrderOnePathMax_scan__bkpntr',
            strict=True)[0])
    return theano.tensor.concatenate([vp_prefix, starting_point.dimshuffle('x')])
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号