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

    https://github.com/apache/spark/pull/9229#discussion_r42792858
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/ann/Layer.scala ---
    @@ -151,42 +160,39 @@ private[ann] object AffineLayerModel {
        * Creates a model of Affine layer
        * @param layer layer properties
        * @param weights vector with weights
    -   * @param position position of weights in the vector
        * @return model of Affine layer
        */
    -  def apply(layer: AffineLayer, weights: Vector, position: Int): 
AffineLayerModel = {
    -    val (w, b) = unroll(weights, position, layer.numIn, layer.numOut)
    +  def apply(layer: AffineLayer, weights: BDV[Double]): AffineLayerModel = {
    +    val (w, b) = unroll(weights, layer.numIn, layer.numOut)
         new AffineLayerModel(w, b)
       }
     
       /**
        * Creates a model of Affine layer
        * @param layer layer properties
    -   * @param seed seed
    +   * @param weights vector for weights initialization
    +   * @param random random number generator
        * @return model of Affine layer
        */
    -  def apply(layer: AffineLayer, seed: Long): AffineLayerModel = {
    -    val (w, b) = randomWeights(layer.numIn, layer.numOut, seed)
    +  def apply(layer: AffineLayer, weights: BDV[Double], random: Random): 
AffineLayerModel = {
    +    val (w, b) = randomWeights(layer.numIn, layer.numOut, weights, random)
         new AffineLayerModel(w, b)
       }
     
       /**
        * Unrolls the weights from the vector
        * @param weights vector with weights
    -   * @param position position of weights for this layer
        * @param numIn number of layer inputs
        * @param numOut number of layer outputs
        * @return matrix A and vector b
        */
       def unroll(
    -    weights: Vector,
    -    position: Int,
    +    weights: BDV[Double],
    --- End diff --
    
    4 indent


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