Github user feynmanliang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7705#discussion_r35792458
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAOptimizer.scala ---
    @@ -463,15 +458,73 @@ final class OnlineLDAOptimizer extends LDAOptimizer {
         new BDM[Double](col, row, temp).t
       }
     
    +
    +  override private[clustering] def getLDAModel(iterationTimes: 
Array[Double]): LDAModel = {
    +    new LocalLDAModel(Matrices.fromBreeze(lambda).transpose, alpha, eta, 
gammaShape)
    +  }
    +
    +}
    +
    +/**
    + * Serializable companion object containing helper methods and shared code 
for
    --- End diff --
    
    @jkbradley Yes, because the entire object is serialized and sent to workers 
during inference. I pulled the method out not just to encourage reuse but to 
also prevent closure capture serializing the entire `OnlineLDAOptimizer` when I 
called this function.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to