You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2026/09/08 08:57:09 UTC

[PR] [SPARK-59313][ML] Eagerly initialize the ANN model in MultilayerPerceptronClassificationModel [spark]

zhengruifeng opened a new pull request, #58608:
URL: https://github.com/apache/spark/pull/58608

   ### What changes were proposed in this pull request?
   
   This PR changes `MultilayerPerceptronClassificationModel` to receive and retain its
   `FeedForwardModel` as a private eager value. The public `weights` accessor becomes a method backed
   by the feed-forward model. Training, copying, and model loading now construct the feed-forward
   model before constructing the classification model.
   
   It also narrows the internal `FeedForwardTopology.model` return types to `FeedForwardModel` and
   updates the probability test to use the public prediction API.
   
   ### Why are the changes needed?
   
   The feed-forward model is the runtime state required by every prediction operation. Constructing it
   up front makes that state explicit and avoids retaining a separate model-level weights field solely
   to lazily reconstruct the feed-forward model. The trained weights remain available through the
   existing public `weights` accessor and continue to be used by persistence and model copying.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   - `build/sbt mllib/compile`
   - `build/sbt 'mllib/testOnly *MultilayerPerceptronClassifierSuite'`
   - `./dev/mima`
   - `./dev/scalastyle`
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Codex (GPT-5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-59313][ML] Avoid serializing FeedForwardModel scratch buffers [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #58608:
URL: https://github.com/apache/spark/pull/58608#issuecomment-5601772321

   **Merge Summary:**
   - merged into master https://github.com/apache/spark/commit/695237002055329161b13dbd6f0f3829baad3955
   - merged into branch-4.x https://github.com/apache/spark/commit/6d45366b8a10e3e8341fc1746221bf5c9b2e618c
   
   *Posted by `merge_spark_pr.py`*


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-59313][ML] Avoid serializing FeedForwardModel scratch buffers [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #58608: [SPARK-59313][ML] Avoid serializing FeedForwardModel scratch buffers
URL: https://github.com/apache/spark/pull/58608


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org