PCT icon indicating copy to clipboard operation
PCT copied to clipboard

Tokens to be integers

Open pchsu-hsupc opened this issue 2 years ago • 5 comments

Hello, I would like to ask about the meaning of tokens being integers. I noticed that the final forward pass to the tokenizer involves the cls_logits_softmax tensor, and it directly performs a matrix multiplication with the codebook. However, these operations are all in floating-point. So, what does it mean for tokens to be integers in classifier stage?

pchsu-hsupc avatar Jun 01 '24 09:06 pchsu-hsupc

I'd like to know too

ndsl555 avatar Jun 24 '24 07:06 ndsl555

Seems like the integer token only happens when stage I training. I think is the variable encoding_indices is this line: https://github.com/Gengzigang/PCT/blob/main/models/pct_tokenizer.py#L142

KunmingS avatar Jul 17 '24 23:07 KunmingS

Seems like the integer token only happens when stage I training. I think is the variable encoding_indices is this line: https://github.com/Gengzigang/PCT/blob/main/models/pct_tokenizer.py#L142

That's true. In stage 1, the encoding_indices would be integers but not in stage 2.

pchsu-hsupc avatar Jul 18 '24 08:07 pchsu-hsupc

image

Figure 1 is quite confusing to me. In the reference stage, the class head output should be logits, and the codebook context is composed of floating-point data. However, this image shows that both are composed of integers, which is what I find puzzling.

pchsu-hsupc avatar Jul 18 '24 08:07 pchsu-hsupc

do you guys know why now? I want to ask

Zdmai avatar Mar 17 '25 07:03 Zdmai