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