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

wrap rm_epsilon_iterative_tropical to python #523

Merged
merged 1 commit into from
Dec 18, 2020

Conversation

qindazhu
Copy link
Collaborator

No description provided.

@qindazhu
Copy link
Collaborator Author

@freewym we have implmented RemoveEpsilonIterativeTropical and tested with random cases, here is the python wrapped function and you can try this version now. If there's any issue, please feel free to ping me.

@freewym
Copy link
Contributor

freewym commented Dec 18, 2020

Sure, Will work on this and let you know.

@qindazhu
Copy link
Collaborator Author

Merigng, so @pzelasko and @freewym can just pull the code instead of checking out this PR. If there's any issue, just leave your comments and I'll fix later.

@qindazhu qindazhu merged commit 212cf60 into k2-fsa:master Dec 18, 2020
@freewym
Copy link
Contributor

freewym commented Dec 21, 2020

@qindazhu I need to inverse the returned Fsa of k2.remove_epsilons_iterative_tropical(), but its aux_labels is a ragged tensor, and inverse is unsupported for that.

@qindazhu
Copy link
Collaborator Author

invert an Fsa with aux_labels as ragged tensor needs to expand arcs (i.e. we need to convert an arc with two aux_labels to two arcs), we have not implemented it.

Can you show your usage for now? We can try to figure out if it's posibble to do it with current code. If we cannot, I'll add the implementation ( I even thought the host version (no GPU support) I wrote before may work well for your purpose for now)

Also @danpovey here as we talked about expandstuff before #481 (comment).

@freewym
Copy link
Contributor

freewym commented Dec 21, 2020

I intended to apply remove_epsilons_iterative_tropical on H, and then do "H compose L" by k2.intersect(H.invert_(), L)

@qindazhu
Copy link
Collaborator Author

Ah, OK, I'll add a wrapper of host version invert to python today, and will add an GPU implementation later (will talk with Dan offline).

BTW, bear in mind before you intersect H.invert_ with L, you may need to remove aux_labels of H.invert_(), as (IIRC) we don't support both A and B have aux_labels when do intersect(A,B).

@qindazhu
Copy link
Collaborator Author

@freewym Host version of invert is here #536, noted it may be slow for large graph as it only works for CPU, you may want to cache the result as we did in snowfall https://github.com/k2-fsa/snowfall/blob/1a6412259402810f29ef00937b54b6171257b054/egs/librispeech/asr/simple_v1/train.py#L224-L231

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