scoring = new JensenShannonDivergence();
}
VectorSet source = vectorSets.get(vkeySource);
VectorSet target = vectorSets.get(vkeyTarget);
Recommendation rec = new Recommendation(source, target, scoring, context.getInt("maxlimits"));
String rkey = rkey(vkeySource, vkeyTarget);
this.recommendations.put(rkey, rec);
source.addListener(rec);
if (target != source) {
target.addListener(rec);
}
if (source.type().equals("dense")) {
for (int srcVecId : source.ids()) {
rec.create(srcVecId);
float[] vector = source.get(srcVecId);
target.rescore(source.key(), srcVecId, vector, rec);
}
} else {
for (int srcVecId : source.ids()) {
rec.create(srcVecId);
int[] vector = source._get(srcVecId);
target.rescore(source.key(), srcVecId, vector, rec);
}
}
}