资源简介
有284个训练样本,273个测试样本,通过对数据的处理后进入基于LSTM的多层循环神经网络进行训练,测试样本测试准确率可达70+
代码片段和文件信息
“““
┏┛ ┻━━━━━┛ ┻┓
┃ ┃
┃ ━ ┃
┃ ┳┛ ┗┳ ┃
┃ ┃
┃ ┻ ┃
┃ ┃
┗━┓ ┏━━━┛
┃ ┃ 神兽保佑
┃ ┃ 代码无BUG!
┃ ┗━━━━━━━━━┓
┃ ┣┓
┃ ┏┛
┗━┓ ┓ ┏━━━┳ ┓ ┏━┛
┃ ┫ ┫ ┃ ┫ ┫
┗━┻━┛ ┗━┻━┛
“““
import tensorflow as tf
import numpy as np
import scipy.io
import time
data =scipy.io.loadmat(‘G2MM06_NormalDataSet_train.mat‘)
data1=scipy.io.loadmat(‘G2MM06_NormalDataSet_test.mat‘)
print(data1[‘DataSet‘][0][0][0][0][5])
pi=data1[‘DataSet‘][0][0][0][0][5]
print(pi[0][0]pi[0][1])
log_dir=‘/tmp/tensorflow/logs/12‘
“““
X_train[0]=np.array(X_train[0])
X_train[0]=np.array(X_train[0])
print(X_train[0][0][1]np.shape(X_train[0]))
“““
lst=[]
for m in range(284):
X_train = data[‘DataSet‘][m][0][0][0][2]
X_train=X_train.T
pi = data[‘DataSet‘][m][0][0][0][5]
for k in range(6):
for i in range(57):
for j in range(1+i):
lst.append(X_train[k][i][j])
lst.append(pi[0][0])
lst.append(pi[0][1])
X_trainNew1=np.array(lst)
X_trainNew1=X_trainNew1.reshape([-11655])
X_trainMu1=data[‘DataSet‘][0][0][0][0][1]
for i in range(283):
X_trainMu1=np.hstack((X_trainMu1data[‘DataSet‘][i+1][0][0][0][1]))
X_trainMu1=X_trainMu1.T
X_trainNew1 = np.hstack((X_trainNew1X_trainMu1))
print(“训练集“)
print(X_trainNew1np.shape(X_trainNew1))
lst3=[]
for m in range(284):
X_train = data[‘DataSet‘][m][0][0][0][4]
X_train=X_train.T
for k in range(6):
for i in range(57):
for j in range(1+i):
lst3.append(X_train[k][i][j])
X_trainNew2=np.array(lst3)
X_trainNew2=X_trainNew2.reshape([-11653])
X_trainMu2=data[‘DataSet‘][0][0][0][0][3]
for i in range(283):
X_trainMu2=np.hstack((X_trainMu2data[‘DataSet‘][i+1][0][0][0][3]))
X_trainMu2=X_trainMu2.T
X_trainNew2 = np.hstack((X_trainNew2X_trainMu2))
print(“训练集“)
print(X_trainNew2np.shape(X_trainNew2))
X_trainNew3=np.hstack((X_trainNew1X_trainNew2))
print(np.shape(X_trainNew3))
lst1=[]
for m in range(273):
X_test = data1[‘DataSet‘][m][0][0][0][2]
X_test=X_test.T
pi = data1[‘DataSet‘][m][0][0][0][5]
for k in range(6):
for i in range(57):
for j in range(1+i):
lst1.append(X_test[k][i][j])
lst1.append(pi[0][0])
lst1.append(pi[0][1])
X_testNew1=np.array(lst1)
X_testNew1=X_testNew1.reshape([-11655])
X_testMu1=data1[‘DataSet‘][0][0][0][0][1]
for i in range(272):
X_testMu1=np.hstack((X_testMu1data1[‘DataSet‘][i+1][0][0][0][1]))
X_testMu1=X_testMu1.T
X_testNew1 = np.hstack((X_testNew1X_testMu1))
print(“测试集“)
print(X_testNew1np.shape(X_testNew1))
lst4=[]
for m in range(273):
X_test = data1[‘DataSet‘][m][0][0][0][4]
X_test=X_test.T
for k in range(6):
for i in range(57):
for j in range(1+i):
lst4.append(X_test[k][i][j])
X_testNew2=np.array(lst4)
X_testNew2
- 上一篇:Qt5.6.1modbus测试程序含收发
- 下一篇:Itchat中文文件支持
相关资源
- 卷积神经网络回归模型
- Python-Keras实现实时语义分割的深层神
- Python-手势识别使用在TensorFlow中卷积神
- python简单神经网络
- 多层BP神经网络参数高自由度Python
- 利用keras实现的cnn卷积神经网络对手写
- snn脉冲神经网络.py
- BP神经网络(马疝病数据集).zip
- 基于vggnet卷积神经网络的图像风格迁
- PSO优化的BP神经网络——python实现
- 简单三层全连接神经网络做二分类问
- 基于神经网络控制一阶倒立摆小车
- 基于sklearn模块的神经网络实现“手写
- 神经网络模型python模板
- CNN卷积神经网络TensorFlow代码
- BP神经网络马疝病数据集
- Python实现循环神经网络RNN
- 房价预测的BP神经网络实现_python代码
- 《PyTorch生成对抗网络编程》思维导图
- 《Python神经网络编程》源代码
- 卷积神经网络(CNN)源码
- BP神经网络及代码分析(python+tensorf
- Python-用TensorFlow实现神经网络实体关系
- Practical Computer Vision Applications Using D
- minist+CNN+交叉验证
- 机器学习神经网络资源
- 无监督神经机器翻译——UnsupervisedM
- python卷积神经网络实现
- 深度学习之一:卷积神经网络(CNN)
- 深度学习之二:用Tensorflow实现卷积神
评论
共有 条评论