From e2144a506fbbc6dbf6ba4db1469f10f9707639c2 Mon Sep 17 00:00:00 2001 From: hypox64 <834201093@qq.com> Date: Fri, 29 Mar 2019 01:19:52 +0800 Subject: [PATCH] Fixed some preprocessing problems --- dataloader.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dataloader.py b/dataloader.py index d11c302..4e4eb6a 100644 --- a/dataloader.py +++ b/dataloader.py @@ -101,10 +101,11 @@ def loaddata_sleep_edf(filedir,filenum,signal_name,BID = 'median',filter = True) signals = signals[events[0][0]:events[-1][0]] events = np.array(events) signals = signals.reshape(-1,3000) - signals = signals*13/np.median(np.abs(signals)) + # signals = signals*13/np.median(np.abs(signals)) stages = events[:,2] stages = stages[:len(signals)] + stages_copy = stages.copy() cnt = 0 for i in range(len(stages_copy)): @@ -112,7 +113,7 @@ def loaddata_sleep_edf(filedir,filenum,signal_name,BID = 'median',filter = True) signals = np.delete(signals,i-cnt,axis =0) stages = np.delete(stages,i-cnt,axis =0) cnt += 1 - + print('shape:',signals.shape,stages.shape) ''' f_stage = pyedflib.EdfReader(os.path.join(filedir,f_stage_name)) -- GitLab