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

implement ComputeForward/BackwardMaxWeights #34

Merged
merged 4 commits into from
May 10, 2020

Conversation

qindazhu
Copy link
Collaborator

@qindazhu qindazhu commented May 9, 2020

  • Implement ComputeForward(Backward)MaxWeights
  • Add weights to FsaRender
  • Changes in determinize.cc are just fixing some style issues.

@qindazhu
Copy link
Collaborator Author

qindazhu commented May 9, 2020

@qindazhu
Copy link
Collaborator Author

qindazhu commented May 9, 2020

Cancelled style check as it took so long time to install cppcheck..

@qindazhu
Copy link
Collaborator Author

qindazhu commented May 9, 2020

Updated, Ready to merge.

@qindazhu
Copy link
Collaborator Author

qindazhu commented May 10, 2020

cppcheck can be disabled by commenting out the following code

mm..OK. BTW, I'm fine with removing cppcheck if you think clang-tidy is good enough.

@qindazhu
Copy link
Collaborator Author

Ready to merge. Please ignore issues from determinize.cc for now

@danpovey
Copy link
Collaborator

Cool, I'll wait for @csukuangfj to merge.

@danpovey
Copy link
Collaborator

BTW, I am considering whether at some point it might make sense to relax the constraint that final_state be numbered last (except for top-sorted FSAs). It might turn out that removing that constraint will simplify code. Just something to keep in mind as you code stuff. We could put this into class Fsa for now, maybe, to make any future change less disruptive.

  int32_t FinalState() const {
    // It's not valid to call this if the FSA is empty.                                                                                                                            
    CHECK(!arc_indexes.empty());
    return arc_indexes.size() - 2;
  }

@qindazhu
Copy link
Collaborator Author

Added! As wee have gotten final_state with int32_t final_state = fsa.NumState() - 1 before, we may need to update those code one by one. ( but for now I believe numbering final state as the last one if convenient)

@csukuangfj
Copy link
Collaborator

+2 merging.

@csukuangfj csukuangfj merged commit 5eb5afe into k2-fsa:master May 10, 2020
@qindazhu qindazhu deleted the haowen-weight branch May 13, 2020 08:18
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.

3 participants