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

Add python API for Warp-CTC op #7438

Merged
merged 4 commits into from
Jan 18, 2018

Conversation

wanghaoshuang
Copy link
Contributor

No description provided.


def warpctc(input, label, blank=0, norm_by_times=False, **kwargs):
"""
An operator integrating the open source warp-ctc library
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. warp-ctc library -> Warp-CTC library, and URL.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx. Done.

"""
An operator integrating the open source warp-ctc library
to compute Connectionist Temporal Classification (CTC) loss.
It can be aliased as softmax with ctc, since a native softmax activation is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctc -> CTC in all doc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx. Done.

of variable-length sequence, which is a 2-D Tensor with LoD
information. It is of the shape [Lg, 1], where Lg is th sum of
all labels' length.
blank: (int, default: 0), the blank label of Connectionist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the blank label -> the blank label index

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx. Fixed.

Temporal Classification (CTC) loss, which is in the
half-opened interval [0, num_classes + 1).
norm_by_times: (bool, default: false), whether to
normalize the gradients by the number of time-step,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems there is no need to normalize the gradient since there is always a mean_op after the loss. Need to pay attention to this, when verifying the model.

qingqing01
qingqing01 previously approved these changes Jan 17, 2018
@wanghaoshuang wanghaoshuang changed the title Add python API for warp-ctc op Add python API for Warp-CTC op Jan 18, 2018
@wanghaoshuang wanghaoshuang merged commit 2360dd2 into PaddlePaddle:develop Jan 18, 2018
@wanghaoshuang wanghaoshuang deleted the ctc_py branch January 18, 2018 09:39
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

Successfully merging this pull request may close these issues.

2 participants