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

docs: Specified comment in SAR about symbol encoding #617

Merged
merged 1 commit into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doctr/models/recognition/sar/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def forward(

# initialize states (each of shape (N, rnn_units))
hx = [None, None]
# Initialize with the index of virtual START symbol (placed after <eos>)
# Initialize with the index of virtual START symbol (placed after <eos> so that the one-hot is only zeros)
symbol = torch.zeros((features.shape[0], self.vocab_size + 1), device=features.device, dtype=features.dtype)
logits_list = []
for t in range(self.max_length + 1): # keep 1 step for <eos>
Expand Down
2 changes: 1 addition & 1 deletion doctr/models/recognition/sar/tensorflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def call(
# run first step of lstm
# holistic: shape (N, rnn_units)
_, states = self.lstm_decoder(holistic, states, **kwargs)
# Initialize with the index of virtual START symbol (placed after <eos>)
# Initialize with the index of virtual START symbol (placed after <eos> so that the one-hot is only zeros)
symbol = tf.fill(features.shape[0], self.vocab_size + 1)
logits_list = []
if kwargs.get('training') and gt is None:
Expand Down