deepAI_demo.py 文件源码

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

项目:deepAI 作者: kaiu85 项目源码 文件源码
def randomize_parameters(params, sigmas, sig_min_perturbations):

    r_params = []
    r_epsilons = []

    for i in range(len(params)):
        epsilon_half = theano_rng.normal((n_perturbations/2,params[i].shape[1],params[i].shape[2]), dtype = theano.config.floatX)
        r_epsilon = T.concatenate( [epsilon_half, -1.0*epsilon_half], axis = 0 )
        r_param = params[i] + r_epsilon*(T.nnet.softplus( sigmas[i] ) + sig_min_perturbations)
        r_params.append(r_param)
        r_epsilons.append(r_epsilon)

    return r_params, r_epsilons

####################################################################
#
# Create randomly perturbed version of parameters
#
####################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号