scores.mapValues(v => math.exp(v - softmax(v)))
But I get compilation error:
Error:(24, 41) could not find implicit value for parameter impl: breeze.linalg.softmax.Impl[Double,VR] .mapValues(v => math.exp(v - softmax(v))) ^ Error:(24, 41) not enough arguments for method apply: (implicit impl: breeze.linalg.softmax.Impl[Double,VR])VR in trait UFunc. Unspecified value parameter impl. .mapValues(v => math.exp(v - softmax(v))) ^
Not at a computer, but do the operation to the counter directly, after importing breeze.linalg._ and breeze.numerics._
val scores: Counter[String, Double] = ...
val values = DenseVector(scores.valuesIterator.toArray)
exp(values - softmax(values))
Thanks a lot!
Regards, Eirik