Document organization
No files matched your search
@@ -1,7 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="ECG_by_Diffenert_CNN_Test" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
|
||||
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 31 KiB |
@@ -6,11 +6,11 @@ import pywt
|
||||
import wfdb
|
||||
import tensorflow as tf
|
||||
from tensorflow import keras
|
||||
from utils import loadData, plot_history_tf, plot_heat_map
|
||||
from utils_oneLayerCNN import loadData, plot_history_tf, plot_heat_map
|
||||
|
||||
#from ECG_read_weiyuqing_without_wfdb import ECGDATAPATH
|
||||
#PATH of this test
|
||||
Project_PATH = "./Number-Of-CNN-Layers/One/"
|
||||
Project_PATH = "../Number-Of-CNN-Layers/One/"
|
||||
#PICTUREPATH= Project_PATH + "picture/"
|
||||
log_dir = Project_PATH + "logs/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
|
||||
model_Path_one = Project_PATH + "model/ecg_model_one_layer.h5"
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
# this file give
|
||||
import os
|
||||
|
||||
import wfdb
|
||||
import pywt
|
||||
@@ -10,13 +10,13 @@ from sklearn.metrics import confusion_matrix
|
||||
from sklearn.model_selection import train_test_split
|
||||
|
||||
# from _mian_tensorflow import Project_PATH
|
||||
Project_PATH = "./Number-Of-CNN-Layers/Two/"
|
||||
Project_PATH = '../Number-Of-CNN-Layers/One/'
|
||||
|
||||
PICTUREPATH = Project_PATH + 'picture/'
|
||||
|
||||
|
||||
# from ECG_read_weiyuqing_without_wfdb import ECGDATAPATH
|
||||
MITBITECGDATAPATH='./MIT-BIT/'
|
||||
MITBITECGDATAPATH = '../MIT-BIT/'
|
||||
|
||||
|
||||
# wavelet denoise preprocess using mallat algorithm
|
||||
|
||||
@@ -92,7 +92,6 @@ def loadData(ratio, random_seed):
|
||||
# print(X_train, X_test, y_train, y_test)
|
||||
return X_train, X_test, y_train, y_test
|
||||
|
||||
|
||||
# train_ds = np.hstack((dataSet, labelSet))
|
||||
# np.random.shuffle(train_ds)
|
||||
#
|
||||
@@ -114,7 +113,7 @@ def plot_heat_map(y_test, y_pred):
|
||||
# normalize
|
||||
# con_mat_norm = con_mat.astype('float') / con_mat.sum(axis=1)[:, np.newaxis]
|
||||
# con_mat_norm = np.around(con_mat_norm, decimals=2)
|
||||
|
||||
# os.remove(PICTUREPATH+'confusion_matrix.png')
|
||||
# plot
|
||||
plt.figure(figsize=(8, 8))
|
||||
seaborn.heatmap(con_mat, annot=True, fmt='.20g', cmap='Blues')
|
||||
@@ -127,6 +126,9 @@ def plot_heat_map(y_test, y_pred):
|
||||
|
||||
|
||||
def plot_history_tf(history):
|
||||
# os.remove(PICTUREPATH+'accuracy.png')
|
||||
# os.remove(PICTUREPATH+'loss.png')
|
||||
|
||||
plt.figure(figsize=(8, 8))
|
||||
plt.plot(history.history['accuracy'])
|
||||
plt.plot(history.history['val_accuracy'])
|
||||