本文整理匯總了Python中model.sequence_loss_fn方法的典型用法代碼示例。如果您正苦於以下問題:Python model.sequence_loss_fn方法的具體用法?Python model.sequence_loss_fn怎麽用?Python model.sequence_loss_fn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類model
的用法示例。
在下文中一共展示了model.sequence_loss_fn方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_sequence_loss_function_without_label_smoothing
# 需要導入模塊: import model [as 別名]
# 或者: from model import sequence_loss_fn [as 別名]
def test_sequence_loss_function_without_label_smoothing(self):
model = self.create_model()
model.set_mparam('sequence_loss_fn', label_smoothing=0)
loss = model.sequence_loss_fn(self.fake_logits, self.fake_labels)
with self.test_session() as sess:
loss_np = sess.run(loss)
# This test checks that the loss function is 'runnable'.
self.assertEqual(loss_np.shape, tuple())