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

    https://github.com/apache/spark/pull/17373#discussion_r131790673
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/ann/Layer.scala ---
    @@ -463,7 +479,7 @@ private[ml] class FeedForwardModel private(
       private var outputs: Array[BDM[Double]] = null
       private var deltas: Array[BDM[Double]] = null
     
    -  override def forward(data: BDM[Double]): Array[BDM[Double]] = {
    +  override def forward(data: BDM[Double], containsLastLayer: Boolean): 
Array[BDM[Double]] = {
         // Initialize output arrays for all layers. Special treatment for 
InPlace
    --- End diff --
    
    @MrBago In `MultiLayerPerceptronClassifier.train` there is a line:
    ```
    val topology = FeedForwardTopology.multiLayerPerceptron(myLayers, 
softmaxOnTop = true)
    ```
    So MultiLayerPerceptronClassifier always use softmax as the last layer.


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