sample_deepAI_demo.py 文件源码

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

项目:deepAI 作者: kaiu85 项目源码 文件源码
def inner_fn_sample_actions_given(oat_given, stm1):

    st0_condition = theano.shared(name = 'st0_condition', value = numpy.random.randn( n_s,n_samples ).astype( dtype = theano.config.floatX ), borrow = True )
    ot0_condition = theano.shared(name = 'ot0_condition', value = numpy.random.randn( n_o,n_samples ).astype( dtype = theano.config.floatX ), borrow = True )
    oht0_condition = theano.shared(name = 'oht0_condition', value = numpy.random.randn( n_oh,n_samples ).astype( dtype = theano.config.floatX ), borrow = True )
    oat0_condition = theano.shared(name = 'oat0_condition', value = numpy.random.randn( n_oa,n_samples ).astype( dtype = theano.config.floatX ), borrow = True )

    # Iterate MCMC sampler to approximate constrained probabilities
    # p(o,oh|oa) of observations, given a sequence of proprioceptive
    # inputs oa
    # c.f. https://arxiv.org/abs/1401.4082, Appendix F.
    ((st, ot, oht, oat), _) = theano.scan(fn=inner_fn_condition, 
                                           outputs_info=[st0_condition, ot0_condition, oht0_condition, oat0_condition],
                                           non_sequences=[oat_given, stm1],
                                           n_steps=n_iterations_ag)

    st = st[-1]
    ot = ot[-1]
    oht = oht[-1]
    oat = oat[-1]    

    return st, ot, oht, oat

# Define initial state and action
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号