做视频网站服务器多少钱,wordpress获取当前页面的别名,oa系统多少钱一套,做地方网站收益怎么样JJCR一区 | Matlab实现GAF-PCNN、GASF-CNN、GADF-CNN的多特征输入数据分类预测/故障诊断 目录 JJCR一区 | Matlab实现GAF-PCNN、GASF-CNN、GADF-CNN的多特征输入数据分类预测/故障诊断分类效果格拉姆矩阵图GAF-PCNNGASF-CNNGADF-CNN 基本介绍程序设计参考资料 分类效果
格拉姆…JJCR一区 | Matlab实现GAF-PCNN、GASF-CNN、GADF-CNN的多特征输入数据分类预测/故障诊断 目录 JJCR一区 | Matlab实现GAF-PCNN、GASF-CNN、GADF-CNN的多特征输入数据分类预测/故障诊断分类效果格拉姆矩阵图GAF-PCNNGASF-CNNGADF-CNN 基本介绍程序设计参考资料 分类效果
格拉姆矩阵图 GAF-PCNN GASF-CNN GADF-CNN 基本介绍
1.Matlab实现GAF-PCNN、GASF-CNN、GADF-CNN的多特征输入数据分类预测/故障诊断三个模型对比运行环境matlab2023b
2.先运行格拉姆矩阵变换进行数据转换然后运行分别GAF_PCNN.mGADF_CNN.mGASF_CNN.m完成多特征输入数据分类预测/故障诊断
GADF_CNN.m是只用到了格拉姆矩阵的GADF矩阵将GADF矩阵送入CNN进行故障诊断。
GASF_CNN.m是只用到了格拉姆矩阵的GASF矩阵将GASF矩阵送入CNN进行故障诊断。
GAF_PCNN.m是将GASF 图与GADF 图同时送入两条并行CNN 中经过卷积-池化后两条CNN网络各输出一组一维向量然后将所输出两组一维向量进行拼接融合通过全连接层后最终将融合特征送入到Softmax 分类器中。
参考文献 PCNN结构 CNN结构
程序设计
完整程序和数据获取方式私信博主回复Matlab实现GAF-PCNN、GASF-CNN、GADF-CNN的多特征输入数据分类预测/故障诊断。
fullyConnectedLayer(classnum,Name,fc12)softmaxLayer(Name,softmax)classificationLayer(Name,classOutput)];lgraph layerGraph(layers1);layers2 [imageInputLayer([size(input2,1) size(input2,2)],Name,vinput) flattenLayer(Nameflatten2)bilstmLayer(15,Outputmode,last,name,bilstm) dropoutLayer(0.1) % Dropout层以概率为0.2丢弃输入reluLayer(Name,relu_2)selfAttentionLayer(2,2,Name,mutilhead-attention) %Attention机制fullyConnectedLayer(10,Name,fc21)];
lgraph addLayers(lgraph,layers2);
lgraph connectLayers(lgraph,fc21,add/in2);plot(lgraph)%% Set the hyper parameters for unet training
options trainingOptions(adam, ... % 优化算法AdamMaxEpochs, 1000, ... % 最大训练次数GradientThreshold, 1, ... % 梯度阈值InitialLearnRate, 0.001, ... % 初始学习率LearnRateSchedule, piecewise, ... % 学习率调整LearnRateDropPeriod,700, ... % 训练100次后开始调整学习率LearnRateDropFactor,0.01, ... % 学习率调整因子L2Regularization, 0.001, ... % 正则化参数ExecutionEnvironment, cpu,... % 训练环境Verbose, 1, ... % 关闭优化过程Plots, none); % 画出曲线
%Code introduction
if nargin2error(You have to supply all required input paremeters, which are ActualLabel, PredictedLabel)
end
if nargin 3isPlot true;
end%plotting the widest polygon
A11;
A21;
A31;
A41;
A51;
A61;a[-A1 -A2/2 A3/2 A4 A5/2 -A6/2 -A1];
b[0 -(A2*sqrt(3))/2 -(A3*sqrt(3))/2 0 (A5*sqrt(3))/2 (A6*sqrt(3))/2 0];if isPlotfigure plot(a, b, --bo,LineWidth,1.3)axis([-1.5 1.5 -1.5 1.5]);set(gca,FontName,Times New Roman,FontSize,12);hold on%grid
end% Calculating the True positive (TP), False Negative (FN), False Positive...
% (FP),True Negative (TN), Classification Accuracy (CA), Sensitivity (SE), Specificity (SP),...
% Kappa (K) and F measure (F_M) metrics
PositiveClassmax(ActualLabel);
NegativeClassmin(ActualLabel);
cpclassperf(ActualLabel,PredictedLabel,Positive,PositiveClass,Negative,NegativeClass);CMcp.DiagnosticTable;TPCM(1,1);FNCM(2,1);FPCM(1,2);TNCM(2,2);CAcp.CorrectRate;SEcp.Sensitivity; %TP/(TPFN)SPcp.Specificity; %TN/(TNFP)PrTP/(TPFP);ReTP/(TPFN);F_M2*Pr*Re/(PrRe);FPRFP/(TNFP);TPRTP/(TPFN);KTP/(TPFPFN);[X1,Y1,T1,AUC] perfcurve(ActualLabel,PredictedLabel,PositiveClass); %ActualLabel(1) means that the first class is assigned as positive class%plotting the calculated CA, SE, SP, AUC, K and F_M on polygon
x[-CA -SE/2 SP/2 AUC K/2 -F_M/2 -CA];
y[0 -(SE*sqrt(3))/2 -(SP*sqrt(3))/2 0 (K*sqrt(3))/2 (F_M*sqrt(3))/2 0];if isPlotplot(x, y, -ko,LineWidth,1)set(gca,FontName,Times New Roman,FontSize,12);
% shadowFill(x,y,pi/4,80)fill(x, y,[0.8706 0.9216 0.9804])
end%calculating the PAM value
% Get the number of vertices
n length(x);
% Initialize the area
p_area 0;
% Apply the formula
for i 1 : n-1p_area p_area (x(i) x(i1)) * (y(i) - y(i1));
end
p_area abs(p_area)/2;%Normalization of the polygon area to one.
PAp_area/2.59807;if isPlot%Plotting the Polygonplot(0,0,r)plot([0 -A1],[0 0] ,--ko)text(-A1-0.3, 0,CA,FontWeight,bold,FontName,Times New Roman)plot([0 -A2/2],[0 -(A2*sqrt(3))/2] ,--ko)text(-0.59,-1.05,SE,FontWeight,bold,FontName,Times New Roman)plot([0 A3/2],[0 -(A3*sqrt(3))/2] ,--ko)text(0.5, -1.05,SP,FontWeight,bold,FontName,Times New Roman)plot([0 A4],[0 0] ,--ko)text(A40.08, 0,AUC,FontWeight,bold,FontName,Times New Roman)plot([0 A5/2],[0 (A5*sqrt(3))/2] ,--ko)text(0.5, 1.05,J,FontWeight,bold,FontName,Times New Roman)daspect([1 1 1])
end
Metrics.PAPA;
Metrics.CACA;
Metrics.SESE;
Metrics.SPSP;
Metrics.AUCAUC;
Metrics.KK;
Metrics.F_MF_M;printVar(:,1)categories;
printVar(:,2){PA, CA, SE, SP, AUC, K, F_M};
disp(预测结果打印:)
for i1:length(categories)fprintf(%23s: %.2f \n, printVar{i,1}, printVar{i,2})
end参考资料 [1] https://blog.csdn.net/kjm13182345320/category_11799242.html?spm1001.2014.3001.5482 [2] https://blog.csdn.net/kjm13182345320/article/details/124571691
文章转载自: http://www.morning.kyctc.cn.gov.cn.kyctc.cn http://www.morning.ktskc.cn.gov.cn.ktskc.cn http://www.morning.rqqct.cn.gov.cn.rqqct.cn http://www.morning.rgfx.cn.gov.cn.rgfx.cn http://www.morning.rytps.cn.gov.cn.rytps.cn http://www.morning.sfgzx.cn.gov.cn.sfgzx.cn http://www.morning.gqksd.cn.gov.cn.gqksd.cn http://www.morning.hwbf.cn.gov.cn.hwbf.cn http://www.morning.jtsdk.cn.gov.cn.jtsdk.cn http://www.morning.nsrtvu.com.gov.cn.nsrtvu.com http://www.morning.njhyk.cn.gov.cn.njhyk.cn http://www.morning.rknsp.cn.gov.cn.rknsp.cn http://www.morning.yrwqz.cn.gov.cn.yrwqz.cn http://www.morning.hwhnx.cn.gov.cn.hwhnx.cn http://www.morning.kqkmx.cn.gov.cn.kqkmx.cn http://www.morning.pwlxy.cn.gov.cn.pwlxy.cn http://www.morning.gnjkn.cn.gov.cn.gnjkn.cn http://www.morning.yrfxb.cn.gov.cn.yrfxb.cn http://www.morning.lgtcg.cn.gov.cn.lgtcg.cn http://www.morning.ptwqf.cn.gov.cn.ptwqf.cn http://www.morning.ltpmy.cn.gov.cn.ltpmy.cn http://www.morning.yzxhk.cn.gov.cn.yzxhk.cn http://www.morning.hdtcj.cn.gov.cn.hdtcj.cn http://www.morning.uytae.cn.gov.cn.uytae.cn http://www.morning.sffkm.cn.gov.cn.sffkm.cn http://www.morning.hfxks.cn.gov.cn.hfxks.cn http://www.morning.mkyxp.cn.gov.cn.mkyxp.cn http://www.morning.ktrzt.cn.gov.cn.ktrzt.cn http://www.morning.jmtrq.cn.gov.cn.jmtrq.cn http://www.morning.mwrxz.cn.gov.cn.mwrxz.cn http://www.morning.ctqbc.cn.gov.cn.ctqbc.cn http://www.morning.jmspy.cn.gov.cn.jmspy.cn http://www.morning.qnftc.cn.gov.cn.qnftc.cn http://www.morning.nfnxp.cn.gov.cn.nfnxp.cn http://www.morning.tjwfk.cn.gov.cn.tjwfk.cn http://www.morning.rqhbt.cn.gov.cn.rqhbt.cn http://www.morning.xnwjt.cn.gov.cn.xnwjt.cn http://www.morning.btsls.cn.gov.cn.btsls.cn http://www.morning.gwjsm.cn.gov.cn.gwjsm.cn http://www.morning.ydyjf.cn.gov.cn.ydyjf.cn http://www.morning.qyhcm.cn.gov.cn.qyhcm.cn http://www.morning.bzwxr.cn.gov.cn.bzwxr.cn http://www.morning.nytpt.cn.gov.cn.nytpt.cn http://www.morning.qjdqj.cn.gov.cn.qjdqj.cn http://www.morning.dhyqg.cn.gov.cn.dhyqg.cn http://www.morning.hsflq.cn.gov.cn.hsflq.cn http://www.morning.nkpml.cn.gov.cn.nkpml.cn http://www.morning.hdscx.cn.gov.cn.hdscx.cn http://www.morning.wkgyz.cn.gov.cn.wkgyz.cn http://www.morning.rxfbf.cn.gov.cn.rxfbf.cn http://www.morning.mynbc.cn.gov.cn.mynbc.cn http://www.morning.zypnt.cn.gov.cn.zypnt.cn http://www.morning.rwfp.cn.gov.cn.rwfp.cn http://www.morning.sqtsl.cn.gov.cn.sqtsl.cn http://www.morning.chhhq.cn.gov.cn.chhhq.cn http://www.morning.ywtbk.cn.gov.cn.ywtbk.cn http://www.morning.wcgcm.cn.gov.cn.wcgcm.cn http://www.morning.yrbhf.cn.gov.cn.yrbhf.cn http://www.morning.fengnue.com.gov.cn.fengnue.com http://www.morning.qrwjb.cn.gov.cn.qrwjb.cn http://www.morning.rgxf.cn.gov.cn.rgxf.cn http://www.morning.wbllx.cn.gov.cn.wbllx.cn http://www.morning.dkcpt.cn.gov.cn.dkcpt.cn http://www.morning.qzpkr.cn.gov.cn.qzpkr.cn http://www.morning.gjlst.cn.gov.cn.gjlst.cn http://www.morning.nccyc.cn.gov.cn.nccyc.cn http://www.morning.wbfg.cn.gov.cn.wbfg.cn http://www.morning.mhnxs.cn.gov.cn.mhnxs.cn http://www.morning.znmwb.cn.gov.cn.znmwb.cn http://www.morning.zczkm.cn.gov.cn.zczkm.cn http://www.morning.zcxjg.cn.gov.cn.zcxjg.cn http://www.morning.bdsyu.cn.gov.cn.bdsyu.cn http://www.morning.zzgkk.cn.gov.cn.zzgkk.cn http://www.morning.ntzbr.cn.gov.cn.ntzbr.cn http://www.morning.qkbwd.cn.gov.cn.qkbwd.cn http://www.morning.clbzy.cn.gov.cn.clbzy.cn http://www.morning.rsnd.cn.gov.cn.rsnd.cn http://www.morning.tpbhf.cn.gov.cn.tpbhf.cn http://www.morning.tnqk.cn.gov.cn.tnqk.cn http://www.morning.tqqfj.cn.gov.cn.tqqfj.cn