mirror of
https://github.com/This-weiyuqing/ECG_by_Diffenert_CNN_Test.git
synced 2026-10-18 03:13:39 +08:00
may be last version
By completing the thesis, we have corrected the deficiencies and fixed some bugs.
This commit is contained in:
1 parent
a13e1ace47
commit
af187d92e9
49 files changed
+129
-7
No files matched your search
@@ -0,0 +1,44 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Created on Sun Mar 11 20:41:57 2018
|
||||
|
||||
@author: brucelau
|
||||
"""
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
x = np.linspace(-10,10)
|
||||
y_sigmoid = 1/(1+np.exp(-x))
|
||||
y_tanh = (np.exp(x)-np.exp(-x))/(np.exp(x)+np.exp(-x))
|
||||
|
||||
fig = plt.figure()
|
||||
# plot sigmoid
|
||||
ax = fig.add_subplot(221)
|
||||
ax.plot(x,y_sigmoid)
|
||||
ax.grid()
|
||||
ax.set_title('(a) Sigmoid')
|
||||
|
||||
# plot tanh
|
||||
ax = fig.add_subplot(222)
|
||||
ax.plot(x,y_tanh)
|
||||
ax.grid()
|
||||
ax.set_title('(b) Tanh')
|
||||
|
||||
# plot relu
|
||||
ax = fig.add_subplot(223)
|
||||
y_relu = np.array([0*item if item<0 else item for item in x ])
|
||||
ax.plot(x,y_relu)
|
||||
ax.grid()
|
||||
ax.set_title('(c) ReLu')
|
||||
|
||||
#plot leaky relu
|
||||
ax = fig.add_subplot(224)
|
||||
y_relu = np.array([0.2*item if item<0 else item for item in x ])
|
||||
ax.plot(x,y_relu)
|
||||
ax.grid()
|
||||
ax.set_title('(d) Leaky ReLu')
|
||||
|
||||
plt.tight_layout()
|
||||
plt.show()
|
||||
|
||||
Reference in new issue
Block a user