test_conjugate_gaussian_models.py 文件源码

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

项目:pyro 作者: uber 项目源码 文件源码
def set_model_permutations(self):
        self.model_permutations = []
        self.model_unpermutations = []
        for n in range(1, self.N):
            permutation = list(range(2 ** (n - 1)))
            if n > 1:
                while permutation == list(range(2 ** (n - 1))):
                    permutation = torch.randperm(2 ** (n - 1)).numpy().tolist()
            self.model_permutations.append(permutation)

            unpermutation = list(range(len(permutation)))
            for i in range(len(permutation)):
                unpermutation[permutation[i]] = i
            self.model_unpermutations.append(unpermutation)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号