本文整理汇总了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)
示例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)