Github user akopich commented on a diff in the pull request:
https://github.com/apache/spark/pull/18924#discussion_r143060537
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAOptimizer.scala ---
@@ -462,31 +463,60 @@ final class OnlineLDAOptimizer extends LDAOptimizer {
val expElogbetaBc = batch.sparkContext.broadcast(expElogbeta)
val alpha = this.alpha.asBreeze
val gammaShape = this.gammaShape
-
- val stats: RDD[(BDM[Double], List[BDV[Double]])] = batch.mapPartitions
{ docs =>
+ val optimizeDocConcentration = this.optimizeDocConcentration
+ // If and only if optimizeDocConcentration is set true,
+ // we calculate logphat in the same pass as other statistics.
+ // No calculation of loghat happens otherwise.
--- End diff --
If I don't assign logphatPartOptionBase to a local variable,
NonSerializableException is generated.
Regarding comments. Isn't it necessary to emphasise that the computation
happens in the same pass?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]