Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

RNN分类之后, 在评估处怎么获得每个字符的概率呢 #50

Open
lijiajun3029 opened this issue Nov 27, 2019 · 1 comment
Open

Comments

@lijiajun3029
Copy link

lijiajun3029 commented Nov 27, 2019

out = K.get_value(K.ctc_decode(y_pred, input_length=np.ones(shape[0]) * shape[1])[0][0])[:, :4]

每个字符的概率该如何读出,我对RNN不熟悉,请大佬指点迷津,万分感谢

@ypwhs
Copy link
Owner

ypwhs commented Nov 28, 2019

y_pred 就是每个字符的概率,比如我们可以对 y_pred 的概率找最大的值来看输出的概率对应的字符:

argmax = np.argmax(y_pred, axis=2)[0]
list(zip(argmax, ''.join([characters2[x] for x in argmax])))

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants