本文整理匯總了Python中object_detection.protos.optimizer_pb2.LearningRate方法的典型用法代碼示例。如果您正苦於以下問題:Python optimizer_pb2.LearningRate方法的具體用法?Python optimizer_pb2.LearningRate怎麽用?Python optimizer_pb2.LearningRate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類object_detection.protos.optimizer_pb2
的用法示例。
在下文中一共展示了optimizer_pb2.LearningRate方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testBuildManualStepLearningRate
# 需要導入模塊: from object_detection.protos import optimizer_pb2 [as 別名]
# 或者: from object_detection.protos.optimizer_pb2 import LearningRate [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.protos import optimizer_pb2 [as 別名]
# 或者: from object_detection.protos.optimizer_pb2 import LearningRate [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.protos import optimizer_pb2 [as 別名]
# 或者: from object_detection.protos.optimizer_pb2 import LearningRate [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.protos import optimizer_pb2 [as 別名]
# 或者: from object_detection.protos.optimizer_pb2 import LearningRate [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.protos import optimizer_pb2 [as 別名]
# 或者: from object_detection.protos.optimizer_pb2 import LearningRate [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.protos import optimizer_pb2 [as 別名]
# 或者: from object_detection.protos.optimizer_pb2 import LearningRate [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.protos import optimizer_pb2 [as 別名]
# 或者: from object_detection.protos.optimizer_pb2 import LearningRate [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.protos import optimizer_pb2 [as 別名]
# 或者: from object_detection.protos.optimizer_pb2 import LearningRate [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.protos import optimizer_pb2 [as 別名]
# 或者: from object_detection.protos.optimizer_pb2 import LearningRate [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.protos import optimizer_pb2 [as 別名]
# 或者: from object_detection.protos.optimizer_pb2 import LearningRate [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)