Skip to content

Instantly share code, notes, and snippets.

@Everfighting
Created January 10, 2020 10:08
Show Gist options
  • Save Everfighting/e9423aea5176d44d7e01db724fbb4290 to your computer and use it in GitHub Desktop.
Save Everfighting/e9423aea5176d44d7e01db724fbb4290 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
import numpy as np
def sigmoid(x):
return 1. / (1. + np.exp(-x))
x = np.arange(-10, 10, 0.1)
y = sigmoid(x)
plt.plot(x, y)
plt.axvline(0.0,ls = 'dotted', color='k')
plt.title(r'Sigmoid函数曲线', fontsize = 15)
plt.text(5,0.8,r'$y = \frac{1}{1+e^{-z}}$', fontsize = 18)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment