-----
-----
-
-------
---
主要是先进行分析,然后--读取数据后 构造卷积网络模型
得到最后的结果
import torch import numpy as np import torch.nn as nn import scipy.io as sio from torch.utils.data import Dataset, DataLoader from sklearn.preprocessing import maxabs_scale
class CWRU_DATA(Dataset): def __init__(self, data_num=100, data_len=1024): # not overlapped self.data, self.label = self.prepare_data(num=data_num, length=data_len) # (4, 100, 1024)
def __len__(self): return len(self.label)
def data_preprocess(self, x): x = x.astype(np.float32) # shape: (N,) x = maxabs_scale(x) return x
def prepare_data(self, num, length): NC = r"1./normal_0_97.mat" IF = r"1/12k_Drive_End_IR007_0_105.mat" OF
|