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