Commit 122c82e9 authored by WenmuZhou's avatar WenmuZhou
Browse files

测试模式时将输出softmax后返回

parent 6241b8f9
...@@ -20,6 +20,7 @@ import math ...@@ -20,6 +20,7 @@ import math
import paddle import paddle
from paddle import ParamAttr, nn from paddle import ParamAttr, nn
from paddle.nn import functional as F
def get_para_bias_attr(l2_decay, k, name): def get_para_bias_attr(l2_decay, k, name):
...@@ -48,4 +49,6 @@ class CTC(nn.Layer): ...@@ -48,4 +49,6 @@ class CTC(nn.Layer):
def forward(self, x, labels=None): def forward(self, x, labels=None):
predicts = self.fc(x) predicts = self.fc(x)
if not self.training:
predicts = F.softmax(predicts, axis=2)
return predicts return predicts
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment