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

    https://github.com/apache/spark/pull/17373#discussion_r133324363
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/ann/Layer.scala ---
    @@ -527,9 +550,21 @@ private[ml] class FeedForwardModel private(
     
       override def predict(data: Vector): Vector = {
         val size = data.size
    -    val result = forward(new BDM[Double](size, 1, data.toArray))
    +    val result = forward(new BDM[Double](size, 1, data.toArray), true)
         Vectors.dense(result.last.toArray)
       }
    +
    +  override def predictRaw(data: Vector): Vector = {
    +    val size = data.size
    +    val result = forward(new BDM[Double](size, 1, data.toArray), false)
    +    Vectors.dense(result(result.length - 2).toArray)
    +  }
    +
    +  override def raw2ProbabilityInPlace(data: Vector): Vector = {
    +    val dataMatrix = new BDM[Double](data.size, 1, data.toArray)
    +    layerModels.last.eval(dataMatrix, dataMatrix)
    --- End diff --
    
    Ping: If this proposal sounds good, then can you please update accordingly?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to