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


Python Dataset.get_permutation方法代码示例

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


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

示例1: setUp

# 需要导入模块: from dataset import Dataset [as 别名]
# 或者: from dataset.Dataset import get_permutation [as 别名]
    def setUp(self):
        ### Testing that the sum of all prob is equal to 1 ###
        # This test has to be run in 64bit for accuracy
        self._old_theano_config_floatX = theano.config.floatX
        theano.config.floatX = 'float64'
        self.nb_test = 15

        self._shuffling_type = "Full"

        fake_dataset = Dataset.get_permutation(self.input_size)
        self.model = MADE(fake_dataset,
                          hidden_sizes=self.hidden_sizes,
                          batch_size=fake_dataset['train']['data'].shape[0],
                          hidden_activation=theano.tensor.nnet.sigmoid,
                          use_cond_mask=self.use_cond_mask,
                          direct_input_connect=self.direct_input_connect,
                          direct_output_connect=self.direct_output_connect)

        # Train the model to have more accurate results
        for i in range(2 * self.input_size):
            self.model.shuffle(self._shuffling_type)
            self.model.learn(i, True)
开发者ID:amoliu,项目名称:MADE,代码行数:24,代码来源:test_autoregressive_property.py

示例2: visual_conditioning_weight

# 需要导入模块: from dataset import Dataset [as 别名]
# 或者: from dataset.Dataset import get_permutation [as 别名]
def visual_conditioning_weight():
    input_size = 7
    hidden_sizes = [5]
    fake_dataset = Dataset.get_permutation(input_size)

    model = _get_conditioning_mask_model(fake_dataset, input_size, hidden_sizes)

    for i, l in enumerate(model.layers):
        print "## layer", i
        for p in l.params:
            print p, ":\n", p.get_value()
        print "weights_mask:"
        print l.weights_mask.get_value()

    # import theano.printing as printing
    # for i, p in enumerate(model.parameters):
    #     model.parameters[i] = printing.Print('{0}{1}'.format(p, i))(model.parameters[i])

    # for i, l in enumerate(model.layers):
    #     model.layers[i].lin_output = printing.Print('output{0}'.format(i))(model.layers[i].lin_output)

    # print fake_dataset['train']['data'][0].eval()
    print model.use([np.ones_like(fake_dataset['train']['data'][0].eval())], False)
开发者ID:amoliu,项目名称:MADE,代码行数:25,代码来源:testMADE.py


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