Explore
Connect
Documentation
Snippets
Log in
Sign up
Sigmoid plot
1
2
3
4
5
6
7
8
9
10
# Create an interval from -5 to 5 in steps of 0.01
a = np.arange(-
5
,
5
,
0.01
)
# Compute corresponding sigmoid function values
s =
1
/ (
1
+ np.exp(-a))
# Plot them
plt.plot(a, s)
plt.grid(
True
)
plt.show()
Enter to Rename, Shift+Enter to Preview
Run