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


Python optimizer_builder._create_learning_rate方法代码示例

本文整理汇总了Python中object_detection.builders.optimizer_builder._create_learning_rate方法的典型用法代码示例。如果您正苦于以下问题:Python optimizer_builder._create_learning_rate方法的具体用法?Python optimizer_builder._create_learning_rate怎么用?Python optimizer_builder._create_learning_rate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在object_detection.builders.optimizer_builder的用法示例。


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

示例1: testBuildManualStepLearningRate

# 需要导入模块: from object_detection.builders import optimizer_builder [as 别名]
# 或者: from object_detection.builders.optimizer_builder import _create_learning_rate [as 别名]
def testBuildManualStepLearningRate(self):
    learning_rate_text_proto = """
      manual_step_learning_rate {
        schedule {
          step: 0
          learning_rate: 0.006
        }
        schedule {
          step: 90000
          learning_rate: 0.00006
        }
      }
    """
    global_summaries = set([])
    learning_rate_proto = optimizer_pb2.LearningRate()
    text_format.Merge(learning_rate_text_proto, learning_rate_proto)
    learning_rate = optimizer_builder._create_learning_rate(
        learning_rate_proto, global_summaries)
    self.assertTrue(isinstance(learning_rate, tf.Tensor)) 
开发者ID:ringringyi,项目名称:DOTA_models,代码行数:21,代码来源:optimizer_builder_test.py

示例2: testBuildManualStepLearningRate

# 需要导入模块: from object_detection.builders import optimizer_builder [as 别名]
# 或者: from object_detection.builders.optimizer_builder import _create_learning_rate [as 别名]
def testBuildManualStepLearningRate(self):
    learning_rate_text_proto = """
      manual_step_learning_rate {
        initial_learning_rate: 0.002
        schedule {
          step: 100
          learning_rate: 0.006
        }
        schedule {
          step: 90000
          learning_rate: 0.00006
        }
        warmup: true
      }
    """
    learning_rate_proto = optimizer_pb2.LearningRate()
    text_format.Merge(learning_rate_text_proto, learning_rate_proto)
    learning_rate = optimizer_builder._create_learning_rate(
        learning_rate_proto)
    self.assertTrue(isinstance(learning_rate, tf.Tensor)) 
开发者ID:ahmetozlu,项目名称:vehicle_counting_tensorflow,代码行数:22,代码来源:optimizer_builder_test.py

示例3: testBuildManualStepLearningRate

# 需要导入模块: from object_detection.builders import optimizer_builder [as 别名]
# 或者: from object_detection.builders.optimizer_builder import _create_learning_rate [as 别名]
def testBuildManualStepLearningRate(self):
    learning_rate_text_proto = """
      manual_step_learning_rate {
        schedule {
          step: 0
          learning_rate: 0.006
        }
        schedule {
          step: 90000
          learning_rate: 0.00006
        }
      }
    """
    learning_rate_proto = optimizer_pb2.LearningRate()
    text_format.Merge(learning_rate_text_proto, learning_rate_proto)
    learning_rate = optimizer_builder._create_learning_rate(
        learning_rate_proto)
    self.assertTrue(isinstance(learning_rate, tf.Tensor)) 
开发者ID:ShreyAmbesh,项目名称:Traffic-Rule-Violation-Detection-System,代码行数:20,代码来源:optimizer_builder_test.py

示例4: testBuildConstantLearningRate

# 需要导入模块: from object_detection.builders import optimizer_builder [as 别名]
# 或者: from object_detection.builders.optimizer_builder import _create_learning_rate [as 别名]
def testBuildConstantLearningRate(self):
    learning_rate_text_proto = """
      constant_learning_rate {
        learning_rate: 0.004
      }
    """
    global_summaries = set([])
    learning_rate_proto = optimizer_pb2.LearningRate()
    text_format.Merge(learning_rate_text_proto, learning_rate_proto)
    learning_rate = optimizer_builder._create_learning_rate(
        learning_rate_proto, global_summaries)
    self.assertAlmostEqual(learning_rate, 0.004) 
开发者ID:ringringyi,项目名称:DOTA_models,代码行数:14,代码来源:optimizer_builder_test.py

示例5: testBuildExponentialDecayLearningRate

# 需要导入模块: from object_detection.builders import optimizer_builder [as 别名]
# 或者: from object_detection.builders.optimizer_builder import _create_learning_rate [as 别名]
def testBuildExponentialDecayLearningRate(self):
    learning_rate_text_proto = """
      exponential_decay_learning_rate {
        initial_learning_rate: 0.004
        decay_steps: 99999
        decay_factor: 0.85
        staircase: false
      }
    """
    global_summaries = set([])
    learning_rate_proto = optimizer_pb2.LearningRate()
    text_format.Merge(learning_rate_text_proto, learning_rate_proto)
    learning_rate = optimizer_builder._create_learning_rate(
        learning_rate_proto, global_summaries)
    self.assertTrue(isinstance(learning_rate, tf.Tensor)) 
开发者ID:ringringyi,项目名称:DOTA_models,代码行数:17,代码来源:optimizer_builder_test.py

示例6: testRaiseErrorOnEmptyLearningRate

# 需要导入模块: from object_detection.builders import optimizer_builder [as 别名]
# 或者: from object_detection.builders.optimizer_builder import _create_learning_rate [as 别名]
def testRaiseErrorOnEmptyLearningRate(self):
    learning_rate_text_proto = """
    """
    global_summaries = set([])
    learning_rate_proto = optimizer_pb2.LearningRate()
    text_format.Merge(learning_rate_text_proto, learning_rate_proto)
    with self.assertRaises(ValueError):
      optimizer_builder._create_learning_rate(
          learning_rate_proto, global_summaries) 
开发者ID:ringringyi,项目名称:DOTA_models,代码行数:11,代码来源:optimizer_builder_test.py

示例7: testBuildConstantLearningRate

# 需要导入模块: from object_detection.builders import optimizer_builder [as 别名]
# 或者: from object_detection.builders.optimizer_builder import _create_learning_rate [as 别名]
def testBuildConstantLearningRate(self):
    learning_rate_text_proto = """
      constant_learning_rate {
        learning_rate: 0.004
      }
    """
    learning_rate_proto = optimizer_pb2.LearningRate()
    text_format.Merge(learning_rate_text_proto, learning_rate_proto)
    learning_rate = optimizer_builder._create_learning_rate(
        learning_rate_proto)
    self.assertTrue(learning_rate.op.name.endswith('learning_rate'))
    with self.test_session():
      learning_rate_out = learning_rate.eval()
    self.assertAlmostEqual(learning_rate_out, 0.004) 
开发者ID:ahmetozlu,项目名称:vehicle_counting_tensorflow,代码行数:16,代码来源:optimizer_builder_test.py

示例8: testBuildExponentialDecayLearningRate

# 需要导入模块: from object_detection.builders import optimizer_builder [as 别名]
# 或者: from object_detection.builders.optimizer_builder import _create_learning_rate [as 别名]
def testBuildExponentialDecayLearningRate(self):
    learning_rate_text_proto = """
      exponential_decay_learning_rate {
        initial_learning_rate: 0.004
        decay_steps: 99999
        decay_factor: 0.85
        staircase: false
      }
    """
    learning_rate_proto = optimizer_pb2.LearningRate()
    text_format.Merge(learning_rate_text_proto, learning_rate_proto)
    learning_rate = optimizer_builder._create_learning_rate(
        learning_rate_proto)
    self.assertTrue(learning_rate.op.name.endswith('learning_rate'))
    self.assertTrue(isinstance(learning_rate, tf.Tensor)) 
开发者ID:ahmetozlu,项目名称:vehicle_counting_tensorflow,代码行数:17,代码来源:optimizer_builder_test.py

示例9: testBuildCosineDecayLearningRate

# 需要导入模块: from object_detection.builders import optimizer_builder [as 别名]
# 或者: from object_detection.builders.optimizer_builder import _create_learning_rate [as 别名]
def testBuildCosineDecayLearningRate(self):
    learning_rate_text_proto = """
      cosine_decay_learning_rate {
        learning_rate_base: 0.002
        total_steps: 20000
        warmup_learning_rate: 0.0001
        warmup_steps: 1000
        hold_base_rate_steps: 20000
      }
    """
    learning_rate_proto = optimizer_pb2.LearningRate()
    text_format.Merge(learning_rate_text_proto, learning_rate_proto)
    learning_rate = optimizer_builder._create_learning_rate(
        learning_rate_proto)
    self.assertTrue(isinstance(learning_rate, tf.Tensor)) 
开发者ID:ahmetozlu,项目名称:vehicle_counting_tensorflow,代码行数:17,代码来源:optimizer_builder_test.py

示例10: testRaiseErrorOnEmptyLearningRate

# 需要导入模块: from object_detection.builders import optimizer_builder [as 别名]
# 或者: from object_detection.builders.optimizer_builder import _create_learning_rate [as 别名]
def testRaiseErrorOnEmptyLearningRate(self):
    learning_rate_text_proto = """
    """
    learning_rate_proto = optimizer_pb2.LearningRate()
    text_format.Merge(learning_rate_text_proto, learning_rate_proto)
    with self.assertRaises(ValueError):
      optimizer_builder._create_learning_rate(learning_rate_proto) 
开发者ID:ahmetozlu,项目名称:vehicle_counting_tensorflow,代码行数:9,代码来源:optimizer_builder_test.py


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