Skip to content

[FlashMatrix]: avoid computation in ifelse #399

Description

@zheng-da
    X1 = -fp.log(1 + fp.exp(-X))
    X2 = X - fp.log(1 + fp.exp(X))
    return fp.where(X > 0, X1, X2)

The code above has redundant computation. log and exp can be expensive. We should avoid unnecessary computation here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions