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


Python ConvolutionalSequence.push_initialization_config方法代码示例

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

开发者ID:jpilaul,项目名称:IFT6266_project,代码行数:31,代码来源:test4.py


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