You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by naftaliharris <gi...@git.apache.org> on 2014/07/30 08:46:59 UTC

[GitHub] spark pull request: Avoid numerical instability

GitHub user naftaliharris opened a pull request:

    https://github.com/apache/spark/pull/1652

    Avoid numerical instability

    This avoids basically doing 1 - 1, for example:
    
    ```python
    >>> from math import exp
    >>> margin = -40
    >>> 1 - 1 / (1 + exp(margin))
    0.0
    >>> exp(margin) / (1 + exp(margin))
    4.248354255291589e-18
    >>>
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/naftaliharris/spark patch-2

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/1652.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1652
    
----
commit 0d55a9fae74edf990a087463a52b81ef196862a2
Author: Naftali Harris <na...@gmail.com>
Date:   2014-07-30T06:46:30Z

    Avoid numerical instability
    
    This avoids basically doing 1 - 1, for example:
    
    >>> from math import exp
    >>> margin = -40
    >>> 1 - 1 / (1 + exp(margin))
    0.0
    >>> exp(margin) / (1 + exp(margin))
    4.248354255291589e-18
    >>>

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: Avoid numerical instability

Posted by mengxr <gi...@git.apache.org>.
Github user mengxr commented on the pull request:

    https://github.com/apache/spark/pull/1652#issuecomment-50645844
  
    LGTM. Merged into master. Thanks!


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: Avoid numerical instability

Posted by mengxr <gi...@git.apache.org>.
Github user mengxr commented on the pull request:

    https://github.com/apache/spark/pull/1652#issuecomment-50634700
  
    Jenkins, add to whitelist.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: Avoid numerical instability

Posted by naftaliharris <gi...@git.apache.org>.
Github user naftaliharris commented on the pull request:

    https://github.com/apache/spark/pull/1652#issuecomment-50655537
  
    Awesome, thank you! :-)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: Avoid numerical instability

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the pull request:

    https://github.com/apache/spark/pull/1652#issuecomment-50595894
  
    Y'know, there's a similar issue in `LogisticGradient.scala`, in lines like:
    
    `math.log(1 + math.exp(margin))`
    
    For -40, this gives 0.0, when really it should be 4.248354255291589e-18. This one can be fixed up with
    
    `math.log1p(math.exp(margin))`
    
    I'll have a look for other instances beyond the 4 I see and open a JIRA? I could mention this PR too to bring it under one umbrella.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: Avoid numerical instability

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/1652#issuecomment-50634958
  
    QA tests have started for PR 1652. This patch merges cleanly. <br>View progress: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/17453/consoleFull


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: Avoid numerical instability

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/1652


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: Avoid numerical instability

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/1652#issuecomment-50643448
  
    QA results for PR 1652:<br>- This patch PASSES unit tests.<br>- This patch merges cleanly<br>- This patch adds no public classes<br><br>For more information see test ouptut:<br>https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/17453/consoleFull


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: Avoid numerical instability

Posted by mengxr <gi...@git.apache.org>.
Github user mengxr commented on the pull request:

    https://github.com/apache/spark/pull/1652#issuecomment-50634715
  
    Jenkins, test this please.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: Avoid numerical instability

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the pull request:

    https://github.com/apache/spark/pull/1652#issuecomment-50603835
  
    See also https://issues.apache.org/jira/browse/SPARK-2748 and https://github.com/apache/spark/pull/1659 . This could be considered part of SPARK-2748.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: Avoid numerical instability

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/1652#issuecomment-50579636
  
    Can one of the admins verify this patch?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---