Open CuongNN218 opened 3 years ago
Hi, thanks for your great work. I was confused by teacher forcing technique. In your prediction.py, you claimed that ` if is_train: for i in range(num_steps):
char_onehots = self._char_to_onehot(text[:, i], onehot_dim=self.num_classes) # hidden : decoder's hidden s_{t-1}, batch_H : encoder's hidden H, char_onehots : one-hot(y_{t-1}) hidden, alpha = self.attention_cell(hidden, batch_H, char_onehots) output_hiddens[:, i, :] = hidden[0] # LSTM hidden index (0: hidden, 1: Cell) probs = self.generator(output_hiddens)
` where char_onehots is y t-1 in decoder but as i understand char_onehots is a one-hot vector https://github.com/clovaai/deep-text-recognition-benchmark/blob/68a80fe97943a111ff1efaf52a63ad8f0f1c0e5d/modules/prediction.py#L40 came from text labels not from previous step outputs in decoder. So your code here is quite similar to teacher forcing technique Feel free to correct me if i was wrong. @ku21fan
Hi, thanks for your great work. I was confused by teacher forcing technique. In your prediction.py, you claimed that ` if is_train: for i in range(num_steps):
one-hot vectors for a i-th char. in a batch
` where char_onehots is y t-1 in decoder but as i understand char_onehots is a one-hot vector https://github.com/clovaai/deep-text-recognition-benchmark/blob/68a80fe97943a111ff1efaf52a63ad8f0f1c0e5d/modules/prediction.py#L40 came from text labels not from previous step outputs in decoder. So your code here is quite similar to teacher forcing technique Feel free to correct me if i was wrong. @ku21fan