spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shadow <gunjan.khan...@gmail.com>
Subject Why is spark library using outputs(i+1) in MultilayerPerceptron for previous Delta Calculations
Date Fri, 06 Oct 2017 08:30:01 GMT
Looking at  this
<https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/ml/ann/Layer.scala#L541>
 
code

for (i <- (L - 2) to (0, -1)) {
    layerModels(i + 1).computePrevDelta(deltas(i + 1), outputs(i + 1),
deltas(i))
}

I want to understand why are we passing outputs(i+1) instead of outputs(i)
in the code snippet above. As far as I understand this is only needed for
sigmoid activation layer which has a derivative as f'(x) = f(x) * (1-f(x)) =
outputs(i) * (1-outputs(i))

Which means in order to find prevDelta we should be using outputs(i).



--
Sent from: http://apache-spark-user-list.1001560.n3.nabble.com/

---------------------------------------------------------------------
To unsubscribe e-mail: user-unsubscribe@spark.apache.org


Mime
View raw message