Open kbramhendra opened 1 year ago
I am afraid you cannot compose two G directly. Please correct me if I'm wrong.
Thank you for replying. I am trying to implement something similar to section 2.4. My understanding is that the output symbols of HLG matches with B so I thought I could compose the two. Which is done in the paper. If not can you please guide me how to do that in k2 what they have mentioned in the paper.
Hi, any update on this, can you please help on this.
I am not using K2 actively right now, but what you are proposing should be possible from the fundamentals, since you are basically just adding the "boost" weight to each arc of the G. My guess is that your HLG is incorrect somehow. It is basically saying that there are no olabels (words) on HLG for some reason, or that your olabels are of type RaggedTensor.
Check this if you haven't already: https://k2-fsa.github.io/k2/python_api/api.html#compose
Also see the note about "If it is a ragged tensor, then it requires that a_fsa.requires_grad is False."
Hi, Thank you very much @galv for responding. I have checked https://k2-fsa.github.io/k2/python_api/api.html#compose and it satisfies the required_grad condition. But it always expecting a tensor , in this fsa_algo.py line 470. if its not a tensor its throwing an exception. Can I convert this to tensor or I have to compose some other way.
expand_ragged_attributes() may help
Thank you @galv and @danpovey . It worked.
Hi...I am trying to compose HLG with B ( boosting graph for words unigram language model). This i am doing to give discount for some words. I am composing following way HLG= k2.compose(HLG,B) But I am facing the following error " raise ValueError("Expected a_fsa to have aux_labels (not ragged): "," Can you please help me this .