当前位置: 首页>>代码示例>>Python>>正文


Python AttributeDict.unlabeled方法代码示例

本文整理汇总了Python中utils.AttributeDict.unlabeled方法的典型用法代码示例。如果您正苦于以下问题:Python AttributeDict.unlabeled方法的具体用法?Python AttributeDict.unlabeled怎么用?Python AttributeDict.unlabeled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在utils.AttributeDict的用法示例。


在下文中一共展示了AttributeDict.unlabeled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: encoder

# 需要导入模块: from utils import AttributeDict [as 别名]
# 或者: from utils.AttributeDict import unlabeled [as 别名]
        def encoder(input_, path_name, input_noise_std=0, noise_std=[]):
            h = input_

            logger.info('  0: noise %g' % input_noise_std)
            if input_noise_std > 0.:
                h = h + self.noise_like(h) * input_noise_std

            d = AttributeDict()
            d.unlabeled = self.new_activation_dict()
            d.labeled = self.new_activation_dict()
            d.labeled.z[0] = self.labeled(h)
            d.unlabeled.z[0] = self.unlabeled(h)
            prev_dim = input_dim
            for i, (spec, _, act_f) in layers[1:]:
                d.labeled.h[i - 1], d.unlabeled.h[i - 1] = self.split_lu(h)
                noise = noise_std[i] if i < len(noise_std) else 0.
                curr_dim, z, m, s, h = self.f(h, prev_dim, spec, i, act_f,
                                              path_name=path_name,
                                              noise_std=noise)
                assert self.layer_dims.get(i) in (None, curr_dim)
                self.layer_dims[i] = curr_dim
                d.labeled.z[i], d.unlabeled.z[i] = self.split_lu(z)
                d.unlabeled.s[i] = s
                d.unlabeled.m[i] = m
                prev_dim = curr_dim
            d.labeled.h[i], d.unlabeled.h[i] = self.split_lu(h)
            return d
开发者ID:fulldecent,项目名称:LRE,代码行数:29,代码来源:ladder.py

示例2: encoder

# 需要导入模块: from utils import AttributeDict [as 别名]
# 或者: from utils.AttributeDict import unlabeled [as 别名]
    def encoder(self, input_, path_name, input_noise_std, noise_std):
        h = input_
        h = h + (self.rstream.normal(size=h.shape).astype(floatX) *
                 input_noise_std)

        d = AttributeDict()
        d.unlabeled = self.new_activation_dict()
        d.labeled = self.new_activation_dict()
        d.labeled.z[0], d.unlabeled.z[0] = self.split_lu(h)
        prev_dim = self.input_dim
        for i, (spec, act_f) in self.layers[1:]:
            d.labeled.h[i - 1], d.unlabeled.h[i - 1] = self.split_lu(h)
            noise = noise_std[i] if i < len(noise_std) else 0.
            curr_dim, z, m, s, h = self.f(h, prev_dim, spec, i, act_f,
                                          path_name=path_name,
                                          noise_std=noise)
            self.layer_dims[i] = curr_dim
            d.labeled.z[i], d.unlabeled.z[i] = self.split_lu(z)
            d.unlabeled.s[i] = s
            d.unlabeled.m[i] = m
            prev_dim = curr_dim
        d.labeled.h[i], d.unlabeled.h[i] = self.split_lu(h)

        return d
开发者ID:codeaudit,项目名称:ladder_network,代码行数:26,代码来源:ladder.py


注:本文中的utils.AttributeDict.unlabeled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。