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

Reply via email to