本文整理匯總了Python中layers.optimize方法的典型用法代碼示例。如果您正苦於以下問題:Python layers.optimize方法的具體用法?Python layers.optimize怎麽用?Python layers.optimize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類layers
的用法示例。
在下文中一共展示了layers.optimize方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: classifier_training
# 需要導入模塊: import layers [as 別名]
# 或者: from layers import optimize [as 別名]
def classifier_training(self):
loss = self.classifier_graph()
train_op = optimize(loss, self.global_step)
return train_op, loss, self.global_step
示例2: language_model_training
# 需要導入模塊: import layers [as 別名]
# 或者: from layers import optimize [as 別名]
def language_model_training(self):
loss = self.language_model_graph()
train_op = optimize(loss, self.global_step)
return train_op, loss, self.global_step
示例3: optimize
# 需要導入模塊: import layers [as 別名]
# 或者: from layers import optimize [as 別名]
def optimize(loss, global_step):
return layers_lib.optimize(
loss, global_step, FLAGS.max_grad_norm, FLAGS.learning_rate,
FLAGS.learning_rate_decay_factor, FLAGS.sync_replicas,
FLAGS.replicas_to_aggregate, FLAGS.task)