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

    https://github.com/apache/spark/pull/9229#discussion_r56207888
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/ann/Layer.scala ---
    @@ -54,39 +77,32 @@ private[ann] trait Layer extends Serializable {
      * Can return weights in Vector format.
      */
     private[ann] trait LayerModel extends Serializable {
    -  /**
    -   * number of weights
    -   */
    -  val size: Int
     
    +  val weights: BDV[Double]
       /**
        * Evaluates the data (process the data through the layer)
        * @param data data
    -   * @return processed data
    +   * @param output output to write to
        */
    -  def eval(data: BDM[Double]): BDM[Double]
    +  def eval(data: BDM[Double], output: BDM[Double]): Unit
     
       /**
        * Computes the delta for back propagation
    -   * @param nextDelta delta of the next layer
    -   * @param input input data
    +   * @param delta delta of this layer
    +   * @param output output of this layer
    +   * @param pDelta storage for the result, the previous delta
        * @return delta
        */
    -  def prevDelta(nextDelta: BDM[Double], input: BDM[Double]): BDM[Double]
    +  def prevDelta(delta: BDM[Double], output: BDM[Double], pDelta: 
BDM[Double]): Unit
    --- End diff --
    
    (minor) Could return `prevDelta` instead of `Unit`


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