-
Notifications
You must be signed in to change notification settings - Fork 100
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
RuntimeException: inferenceWithScores not supported for ViterbiLayer #655
Comments
I'm finally looking. Sorry for the delay. |
I wonder whether the scores are really necessary given that access isn't provided. So the hierarchy is
and Greedy has it while Viterbi doesn't. It seems like there needs to be a Utils.viterbiWithScores for ViterbiForwardLayer.inferenceWithScores in the same way inference calls Utils.viterbi. That could probably be made by keeping track of backScores along with backPointers. That probably doesn't answer your question. If you replace inferenceWithScore with just inference won't you lose the scores you are trying to locate? Is it loss() that you need instead? |
This one is on me. I implemented it for greedy inference, and did not implement it yet for Viterbi. |
I guess what I really need to return from the viterbi() method in Utils.scala is |
ok. |
@harisriaz17, keep in mind there is one viterbi in |
Will this for sure be needed eventually, or is it contingent on things that might not happen? I.e., will implementing it now be potentially wasted effort? |
I am trying to get the scores for the predictions of the LSTM-CRF model.
In line 327 of Metal.scala, replacing:
Layers.predict(model, taskId, sentence, modHeadPairsOpt, constEmbeddings)
function withLayers.predictWithScores(model, taskId, sentence, modHeadPairsOpt, constEmbeddings, true)
causes the exception to be raised.In line 295 of Layers.scala,
predictWithScores
makes a call toinferenceWithScores
in ViterbiForwardLayer.scala which is not implemented.Should I replace the call to
inferenceWithScores
with justinference
, which is being used by the defaultLayers.predict
?The text was updated successfully, but these errors were encountered: