forked from aburkov/theMLbook
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstandard_logistic_function.py
More file actions
29 lines (23 loc) · 991 Bytes
/
standard_logistic_function.py
File metadata and controls
29 lines (23 loc) · 991 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import matplotlib.pylab as plt
import matplotlib
import numpy as np
matplotlib.rcParams['mathtext.fontset'] = 'stix'
matplotlib.rcParams['font.family'] = 'STIXGeneral'
matplotlib.rcParams.update({'font.size': 18})
def sigmoid(x):
"""
evaluate the boltzman function with midpoint xmid and time constant tau
over x
"""
return 1. / (1. + np.exp(-x))
x = np.linspace(-6, 6, 100)
S = sigmoid(x)
plt.plot(x, S, color='red', lw=2)
plt.xlabel("$x$")
plt.ylabel("$f(x)$")
fig1 = plt.gcf()
fig1.subplots_adjust(top = 0.98, bottom = 0.1, right = 0.98, left = 0.08, hspace = 0, wspace = 0)
fig1.savefig('../../Illustrations/standard_logistic_function.eps', format='eps', dpi=1000, bbox_inches = 'tight', pad_inches = 0)
fig1.savefig('../../Illustrations/standard_logistic_function.pdf', format='pdf', dpi=1000, bbox_inches = 'tight', pad_inches = 0)
fig1.savefig('../../Illustrations/standard_logistic_function.png', dpi=1000, bbox_inches = 'tight', pad_inches = 0)
plt.show()