當前位置: 首頁>>代碼示例>>Python>>正文


Python nasnet.cifar_config方法代碼示例

本文整理匯總了Python中nets.nasnet.nasnet.cifar_config方法的典型用法代碼示例。如果您正苦於以下問題:Python nasnet.cifar_config方法的具體用法?Python nasnet.cifar_config怎麽用?Python nasnet.cifar_config使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在nets.nasnet.nasnet的用法示例。


在下文中一共展示了nasnet.cifar_config方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: testNoAuxHeadCifarModel

# 需要導入模塊: from nets.nasnet import nasnet [as 別名]
# 或者: from nets.nasnet.nasnet import cifar_config [as 別名]
def testNoAuxHeadCifarModel(self):
    batch_size = 5
    height, width = 32, 32
    num_classes = 10
    for use_aux_head in (True, False):
      tf.reset_default_graph()
      inputs = tf.random_uniform((batch_size, height, width, 3))
      tf.train.create_global_step()
      config = nasnet.cifar_config()
      config.set_hparam('use_aux_head', int(use_aux_head))
      with slim.arg_scope(nasnet.nasnet_cifar_arg_scope()):
        _, end_points = nasnet.build_nasnet_cifar(inputs, num_classes,
                                                  config=config)
      self.assertEqual('AuxLogits' in end_points, use_aux_head) 
開發者ID:leimao,項目名稱:DeepLab_v3,代碼行數:16,代碼來源:nasnet_test.py

示例2: testOverrideHParamsCifarModel

# 需要導入模塊: from nets.nasnet import nasnet [as 別名]
# 或者: from nets.nasnet.nasnet import cifar_config [as 別名]
def testOverrideHParamsCifarModel(self):
    batch_size = 5
    height, width = 32, 32
    num_classes = 10
    inputs = tf.random_uniform((batch_size, height, width, 3))
    tf.train.create_global_step()
    config = nasnet.cifar_config()
    config.set_hparam('data_format', 'NCHW')
    with slim.arg_scope(nasnet.nasnet_cifar_arg_scope()):
      _, end_points = nasnet.build_nasnet_cifar(
          inputs, num_classes, config=config)
    self.assertListEqual(
        end_points['Stem'].shape.as_list(), [batch_size, 96, 32, 32]) 
開發者ID:leimao,項目名稱:DeepLab_v3,代碼行數:15,代碼來源:nasnet_test.py

示例3: testUseBoundedAcitvationCifarModel

# 需要導入模塊: from nets.nasnet import nasnet [as 別名]
# 或者: from nets.nasnet.nasnet import cifar_config [as 別名]
def testUseBoundedAcitvationCifarModel(self):
    batch_size = 1
    height, width = 32, 32
    num_classes = 10
    for use_bounded_activation in (True, False):
      tf.reset_default_graph()
      inputs = tf.random_uniform((batch_size, height, width, 3))
      config = nasnet.cifar_config()
      config.set_hparam('use_bounded_activation', use_bounded_activation)
      with slim.arg_scope(nasnet.nasnet_cifar_arg_scope()):
        _, _ = nasnet.build_nasnet_cifar(
            inputs, num_classes, config=config)
      for node in tf.get_default_graph().as_graph_def().node:
        if node.op.startswith('Relu'):
          self.assertEqual(node.op == 'Relu6', use_bounded_activation) 
開發者ID:IBM,項目名稱:MAX-Image-Segmenter,代碼行數:17,代碼來源:nasnet_test.py

示例4: testNoAuxHeadCifarModel

# 需要導入模塊: from nets.nasnet import nasnet [as 別名]
# 或者: from nets.nasnet.nasnet import cifar_config [as 別名]
def testNoAuxHeadCifarModel(self):
    batch_size = 5
    height, width = 32, 32
    num_classes = 10
    for use_aux_head in (True, False):
      tf.reset_default_graph()
      inputs = tf.random.uniform((batch_size, height, width, 3))
      tf.train.create_global_step()
      config = nasnet.cifar_config()
      config.set_hparam('use_aux_head', int(use_aux_head))
      with slim.arg_scope(nasnet.nasnet_cifar_arg_scope()):
        _, end_points = nasnet.build_nasnet_cifar(inputs, num_classes,
                                                  config=config)
      self.assertEqual('AuxLogits' in end_points, use_aux_head) 
開發者ID:tensorflow,項目名稱:models,代碼行數:16,代碼來源:nasnet_test.py

示例5: testOverrideHParamsCifarModel

# 需要導入模塊: from nets.nasnet import nasnet [as 別名]
# 或者: from nets.nasnet.nasnet import cifar_config [as 別名]
def testOverrideHParamsCifarModel(self):
    batch_size = 5
    height, width = 32, 32
    num_classes = 10
    inputs = tf.random.uniform((batch_size, height, width, 3))
    tf.train.create_global_step()
    config = nasnet.cifar_config()
    config.set_hparam('data_format', 'NCHW')
    with slim.arg_scope(nasnet.nasnet_cifar_arg_scope()):
      _, end_points = nasnet.build_nasnet_cifar(
          inputs, num_classes, config=config)
    self.assertListEqual(
        end_points['Stem'].shape.as_list(), [batch_size, 96, 32, 32]) 
開發者ID:tensorflow,項目名稱:models,代碼行數:15,代碼來源:nasnet_test.py

示例6: testUseBoundedAcitvationCifarModel

# 需要導入模塊: from nets.nasnet import nasnet [as 別名]
# 或者: from nets.nasnet.nasnet import cifar_config [as 別名]
def testUseBoundedAcitvationCifarModel(self):
    batch_size = 1
    height, width = 32, 32
    num_classes = 10
    for use_bounded_activation in (True, False):
      tf.reset_default_graph()
      inputs = tf.random.uniform((batch_size, height, width, 3))
      config = nasnet.cifar_config()
      config.set_hparam('use_bounded_activation', use_bounded_activation)
      with slim.arg_scope(nasnet.nasnet_cifar_arg_scope()):
        _, _ = nasnet.build_nasnet_cifar(
            inputs, num_classes, config=config)
      for node in tf.get_default_graph().as_graph_def().node:
        if node.op.startswith('Relu'):
          self.assertEqual(node.op == 'Relu6', use_bounded_activation) 
開發者ID:tensorflow,項目名稱:models,代碼行數:17,代碼來源:nasnet_test.py


注:本文中的nets.nasnet.nasnet.cifar_config方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。