In [1]:
%pylab
%matplotlib inline


Using matplotlib backend: MacOSX
Populating the interactive namespace from numpy and matplotlib

In [2]:
%load_ext watermark
%watermark


2016-09-11T20:35:20

CPython 3.5.2
IPython 5.0.0

compiler   : GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)
system     : Darwin
release    : 15.6.0
machine    : x86_64
processor  : i386
CPU cores  : 8
interpreter: 64bit

In [3]:
x = np.arange(-10., 10., 0.1)
y = 1 / (1 + np.exp(-x))

In [4]:
plt.ylabel('Y')
plt.ylim([0, 1.006])
plt.xlabel('X')
plt.plot(x, y)
plt.axhline(0.5, color='red')
plt.axvline(0, color='red')
plt.show()



In [5]:
dy = y * (1 - y)

In [6]:
plt.ylabel('dy')
plt.ylim([0, 0.27])
plt.xlabel('X')
plt.plot(x, dy)
plt.axvline(0, color='red')
plt.show()



In [ ]: