Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
DB Tsai committed Jan 7, 2015
1 parent 49f3658 commit 23144f3
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ class LogisticGradient extends Gradient {
val margin = -1.0 * dot(data, weights)
/**
* gradientMultiplier = (1.0 / (1.0 + math.exp(margin))) - label
* However, the first part of gradientMultiplier can be potentially suffered from overflow,
* so we use the equivalent formula but more numerically stable.
* However, the first part of gradientMultiplier will be suffered from overflow if there are
* samples far away from hyperplane, and this happens when there are outliers in data.
* As a result, we use the equivalent formula but more numerically stable.
*/
val gradientMultiplier =
if (margin > 0.0) {
Expand Down Expand Up @@ -96,8 +97,9 @@ class LogisticGradient extends Gradient {
val margin = -1.0 * dot(data, weights)
/**
* gradientMultiplier = (1.0 / (1.0 + math.exp(margin))) - label
* However, the first part of gradientMultiplier can be potentially suffered from overflow,
* so we use the equivalent formula but more numerically stable.
* However, the first part of gradientMultiplier will be suffered from overflow if there are
* samples far away from hyperplane, and this happens when there are outliers in data.
* As a result, we use the equivalent formula but more numerically stable.
*/
val gradientMultiplier =
if (margin > 0.0) {
Expand Down

0 comments on commit 23144f3

Please sign in to comment.