Skip to content

Commit

Permalink
formating
Browse files Browse the repository at this point in the history
  • Loading branch information
DB Tsai committed Jan 7, 2015
1 parent f8447f9 commit 6c29ed3
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ class LogisticGradient extends Gradient {
* However, the first part of gradientMultiplier can be potentially suffered from overflow,
* so we use the equivalent formula but more numerically stable.
*/
val gradientMultiplier = if (margin > 0.0) {
val temp = math.exp(-margin)
temp / (1.0 + temp) - label
} else {
1.0 / (1.0 + math.exp(margin)) - label
}
val gradientMultiplier =
if (margin > 0.0) {
val temp = math.exp(-margin)
temp / (1.0 + temp) - label
} else {
1.0 / (1.0 + math.exp(margin)) - label
}

val gradient = data.copy
scal(gradientMultiplier, gradient)
Expand Down

0 comments on commit 6c29ed3

Please sign in to comment.