custom_layers.py 文件源码

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

项目:urnn 作者: stwisdom 项目源码 文件源码
def unitary_ASB2016_init(shape, name=None):
    assert shape[0]==shape[1]
    N=shape[1]

    theta = initializations.uniform((3,N),scale=np.pi,name='{}_theta'.format(name))
    reflection = initializations.glorot_uniform((2,2*N),name='{}_reflection'.format(name))
    idxperm = np.random.permutation(N)
    idxpermaug = np.concatenate((idxperm,N+idxperm))

    Iaug=augLeft(np.concatenate((np.eye(N),np.zeros((N,N))),axis=0),module=np).astype(np.float32)
    Uaug=times_unitary_ASB2016(Iaug,N,[theta,reflection,idxpermaug])

    return Uaug,theta,reflection,idxpermaug
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号