Sigmoid Activation

EasyMachine LearningMath

Description

Given a number x, return the sigmoid 1 / (1 + e^(-x)), rounded to 4 decimal places.

Examples

Input:x = 0
Output:0.5
Explanation:

Passing 0 through the logistic function yields 0.5.

Input:x = 2
Output:0.8808
Explanation:

Passing 2 through the logistic function yields 0.8808.

Input:x = -1
Output:0.2689
Explanation:

Passing -1 through the logistic function yields 0.2689.

Constraints

  • -100 ≤ x ≤ 100

Ready to solve this problem?

Practice solo and sharpen your skills for technical interviews.