Python keras.backend 模块,ctc_batch_cost() 实例源码
我们从Python开源项目中,提取了以下10个代码示例,用于说明如何使用keras.backend.ctc_batch_cost()。
def _ctc_lambda(args):
prediction_batch, label_batch, prediction_lengths, label_lengths = args
return backend.ctc_batch_cost(y_true=label_batch, y_pred=prediction_batch,
input_length=prediction_lengths, label_length=label_lengths)
def ctc_lambda_func(args):
y_pred, labels, input_length, label_length = args
# the 2 is critical here since the first couple outputs of the RNN
# tend to be garbage:
y_pred = y_pred[:, 2:, :]
return K.ctc_batch_cost(labels, y_pred, label_length)
# For a real OCR application,this should be beam search with a dictionary
# and language model. For this example,best path is sufficient.
def ctc_lambda_func(args):
y_pred, :]
ctc_batch_loss = K.ctc_batch_cost(labels, label_length)
return ctc_batch_loss
def ctc_lambda_func(args):
y_pred,best path is sufficient.
def ctc_lambda_func(args):
y_pred,best path is sufficient.
def ctc_lambda_func(args):
#labels,y_pred,input_length,label_length = args
y_pred = args[:,2:,:]
#y_pred = y_pred[:,2:,:]
return K.ctc_decode(y_pred,self.MS_OUTPUT_SIZE)
#return K.ctc_batch_cost(labels,label_length)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。