kotlindl
kotlindl copied to clipboard
Refactor OnnxInferenceModel to reduce code duplication
I think it would be a good idea to unify this (predictSoftly) method with predictRaw
(as a separate PR).
Originally posted by @juliabeliaeva in https://github.com/JetBrains/KotlinDL/pull/356#discussion_r852313090
Keep in mind the predictSoftly method for the TensorFlow models before refactoring
The initial idea of the predictSoftly method is the following: return the vector of probabilities instead of the class label calculated via argmax on the vector of probabilities.
The semantic for the predictRaw is more common – to return just low-level output with a few tensors, for example, not just 1D vector