Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

the num of num_classes #27

Open
saberSabersaber opened this issue Aug 17, 2018 · 1 comment
Open

the num of num_classes #27

saberSabersaber opened this issue Aug 17, 2018 · 1 comment

Comments

@saberSabersaber
Copy link

saberSabersaber commented Aug 17, 2018

hi, thank you for your codes. I am confused by the num_classes,.
+-* + () + 10 digit + blank + space
num_classes = 3 + 2 + 10 + 1 + 1
I understand the ctc loss need to add a special ctc_blank, but there is no space in the label ,why there are add two 1 ?
I notice that in the training phase, the code run the below part to generate label
charset = '0123456789+-*()'
encode_maps = {}
decode_maps = {}
for i, char in enumerate(charset, 1):
encode_maps[char] = i
decode_maps[i] = char

SPACE_INDEX = 0
SPACE_TOKEN = ''
encode_maps[SPACE_TOKEN] = SPACE_INDEX
decode_maps[SPACE_INDEX] = SPACE_TOKEN
I mean there is no space in you lable, so if remove encode_maps[SPACE_TOKEN] = SPACE_INDEX, does the num_class will not need to add another 1?

@zhoukaii
Copy link

zhoukaii commented Mar 5, 2020

same question
can i use my data to train?

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

No branches or pull requests

2 participants