Github user myui commented on a diff in the pull request:
https://github.com/apache/incubator-hivemall/pull/66#discussion_r111727992
--- Diff: core/src/main/java/hivemall/topicmodel/OnlineLDAModel.java ---
@@ -350,66 +348,80 @@ private float computeApproxBoundForMiniBatch() {
float score = 0.f;
// prepare
- final float[] gammaSum = new float[_miniBatchSize];
- for (int d = 0; d < gammaSum.length; d++) {
- gammaSum[d] += MathUtils.sum(_gamma[d], _K);
+ float[] gammaSum = new float[_miniBatchSize];
+ Arrays.fill(gammaSum, 0.f);
--- End diff --
zero filling is not required in java. `gammaSum` has initialized with 0 for
each entry.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---