Closed benson-basis closed 8 years ago
Changing this method in ColumnMajorVector got the time on 10MB of English wikipedia from:
Decode: 0:04:08.748
to
Decode: 0:03:17.926
@Override public void addScores(SparseVector x, float[] scores) { List<SparseItem> itemVector = x.getVector(); int featureSize = getFeatureSize(); itemVector.stream().filter(p -> p.getIndex() < featureSize) .forEach(p -> { int index = p.getIndex() * label_size; for (int i = 0; i < scores.length; i++) { scores[i] += get(index++) * p.getValue(); } }); }
Could you please make a pull request with your change? I'll review and merge the change. Thanks.
I added the PR to the core project where the class lives, so I'm closing this issue.
Changing this method in ColumnMajorVector got the time on 10MB of English wikipedia from:
Decode: 0:04:08.748
to
Decode: 0:03:17.926