• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python convolutional.conv2d_transpose函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tensorflow.python.layers.convolutional.conv2d_transpose函数的典型用法代码示例。如果您正苦于以下问题:Python conv2d_transpose函数的具体用法?Python conv2d_transpose怎么用?Python conv2d_transpose使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: testFunctionalConv2DTransposeNoReuse

 def testFunctionalConv2DTransposeNoReuse(self):
   height, width = 7, 9
   images = random_ops.random_uniform((5, height, width, 3), seed=1)
   conv_layers.conv2d_transpose(images, 32, [3, 3])
   self.assertEqual(len(variables.trainable_variables()), 2)
   conv_layers.conv2d_transpose(images, 32, [3, 3])
   self.assertEqual(len(variables.trainable_variables()), 4)
开发者ID:AndrewTwinz,项目名称:tensorflow,代码行数:7,代码来源:convolutional_test.py


示例2: testInvalidKernelSize

  def testInvalidKernelSize(self):
    height, width = 7, 9
    images = random_ops.random_uniform((5, height, width, 3), seed=1)
    with self.assertRaisesRegexp(ValueError, 'kernel_size'):
      conv_layers.conv2d_transpose(images, 32, (1, 2, 3))

    with self.assertRaisesRegexp(ValueError, 'kernel_size'):
      conv_layers.conv2d_transpose(images, 32, None)
开发者ID:AndrewTwinz,项目名称:tensorflow,代码行数:8,代码来源:convolutional_test.py


示例3: testInvalidStrides

  def testInvalidStrides(self):
    height, width = 7, 9
    images = random_ops.random_uniform((5, height, width, 3), seed=1)
    with self.assertRaisesRegexp(ValueError, 'strides'):
      conv_layers.conv2d_transpose(images, 32, 3, strides=(1, 2, 3))

    with self.assertRaisesRegexp(ValueError, 'strides'):
      conv_layers.conv2d_transpose(images, 32, 3, strides=None)
开发者ID:AndrewTwinz,项目名称:tensorflow,代码行数:8,代码来源:convolutional_test.py


示例4: testFunctionalConv2DTransposeReuseFromScope

 def testFunctionalConv2DTransposeReuseFromScope(self):
   with variable_scope.variable_scope('scope'):
     height, width = 7, 9
     images = random_ops.random_uniform((5, height, width, 3), seed=1)
     conv_layers.conv2d_transpose(images, 32, [3, 3], name='deconv1')
     self.assertEqual(len(variables.trainable_variables()), 2)
   with variable_scope.variable_scope('scope', reuse=True):
     conv_layers.conv2d_transpose(images, 32, [3, 3], name='deconv1')
     self.assertEqual(len(variables.trainable_variables()), 2)
开发者ID:AndrewTwinz,项目名称:tensorflow,代码行数:9,代码来源:convolutional_test.py


示例5: testFunctionalConv2DTransposeNoReuse

 def testFunctionalConv2DTransposeNoReuse(self):
   height, width = 7, 9
   images = random_ops.random_uniform((5, height, width, 3), seed=1)
   conv_layers.conv2d_transpose(images, 32, [3, 3])
   self.assertEqual(
       len(ops.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)), 2)
   conv_layers.conv2d_transpose(images, 32, [3, 3])
   self.assertEqual(
       len(ops.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)), 4)
开发者ID:AliMiraftab,项目名称:tensorflow,代码行数:9,代码来源:convolutional_test.py


示例6: testConv2DTransposeFloat16

 def testConv2DTransposeFloat16(self):
   height, width = 7, 9
   images = random_ops.random_uniform((5, height, width, 4), dtype='float16')
   output = conv_layers.conv2d_transpose(images, 32, [3, 3],
                                         activation=nn_ops.relu)
   self.assertListEqual(output.get_shape().as_list(),
                        [5, height + 2, width + 2, 32])
开发者ID:AndrewTwinz,项目名称:tensorflow,代码行数:7,代码来源:convolutional_test.py


示例7: testFunctionalConv2DTransposeInitializerFromScope

 def testFunctionalConv2DTransposeInitializerFromScope(self):
   with self.test_session() as sess:
     with variable_scope.variable_scope(
         'scope', initializer=init_ops.ones_initializer()):
       height, width = 7, 9
       images = random_ops.random_uniform((5, height, width, 3), seed=1)
       conv_layers.conv2d_transpose(images, 32, [3, 3], name='deconv1')
       weights = variables.trainable_variables()
       # Check the names of weights in order.
       self.assertTrue('kernel' in weights[0].name)
       self.assertTrue('bias' in weights[1].name)
       sess.run(variables.global_variables_initializer())
       weights = sess.run(weights)
       # Check that the kernel weights got initialized to ones (from scope)
       self.assertAllClose(weights[0], np.ones((3, 3, 32, 3)))
       # Check that the bias still got initialized to zeros.
       self.assertAllClose(weights[1], np.zeros((32)))
开发者ID:AndrewTwinz,项目名称:tensorflow,代码行数:17,代码来源:convolutional_test.py


示例8: testInvalidDataFormat

 def testInvalidDataFormat(self):
   height, width = 7, 9
   images = random_ops.random_uniform((5, height, width, 3), seed=1)
   with self.assertRaisesRegexp(ValueError, 'data_format'):
     conv_layers.conv2d_transpose(images, 32, 3, data_format='invalid')
开发者ID:AndrewTwinz,项目名称:tensorflow,代码行数:5,代码来源:convolutional_test.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python convolutional.separable_conv2d函数代码示例发布时间:2022-05-27
下一篇:
Python convolutional.conv2d函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap