本文整理汇总了Python中blocks.bricks.conv.ConvolutionalSequence.push_initialization_config方法的典型用法代码示例。如果您正苦于以下问题:Python ConvolutionalSequence.push_initialization_config方法的具体用法?Python ConvolutionalSequence.push_initialization_config怎么用?Python ConvolutionalSequence.push_initialization_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类blocks.bricks.conv.ConvolutionalSequence
的用法示例。
在下文中一共展示了ConvolutionalSequence.push_initialization_config方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: enumerate
# 需要导入模块: from blocks.bricks.conv import ConvolutionalSequence [as 别名]
# 或者: from blocks.bricks.conv.ConvolutionalSequence import push_initialization_config [as 别名]
border_mode=border_mode,
name='conv_{}'.format(i))
for i, (filter_size, num_filter)
in enumerate(zip(filter_sizes, num_filters))),
conv_activations,
(MaxPooling(pooling_sizes, name='pool_{}'.format(i))
for i, size in enumerate(pooling_sizes))]))
convnet = ConvolutionalSequence(conv_layers, num_channels=3,
image_size=(32, 32),
weights_init=Uniform(0, 0.2),
biases_init=Constant(0.))
convnet.push_initialization_config()
convnet.initialize()
conv_features = Flattener().apply(convnet.apply(X))
# MLP
mlp = MLP(activations=[Logistic(name='sigmoid_0'),
Softmax(name='softmax_1')], dims=[256, 256, 256, 2],
weights_init=IsotropicGaussian(0.01), biases_init=Constant(0))
[child.name for child in mlp.children]
['linear_0', 'sigmoid_0', 'linear_1', 'softmax_1']
Y = mlp.apply(conv_features)
mlp.initialize()