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


Python optimizer_pb2.LearningRate方法代碼示例

本文整理匯總了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)) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:21,代碼來源:optimizer_builder_test.py

示例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)) 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:22,代碼來源:optimizer_builder_test.py

示例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) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:14,代碼來源:optimizer_builder_test.py

示例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)) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:17,代碼來源:optimizer_builder_test.py

示例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) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:11,代碼來源:optimizer_builder_test.py

示例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) 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:16,代碼來源:optimizer_builder_test.py

示例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)) 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:17,代碼來源:optimizer_builder_test.py

示例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)) 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:17,代碼來源:optimizer_builder_test.py

示例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) 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:9,代碼來源:optimizer_builder_test.py


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