Skip to content

Commit

Permalink
Update FPD_SA_Online.m
Browse files Browse the repository at this point in the history
  • Loading branch information
yilingo authored Feb 8, 2023
1 parent f4e68db commit ecad244
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions functions/FPD_SA_Online.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
%% Functions and algorithm
methods (Static = true)
function model = SA(model,SelTrainA,NumEech4SA,sigfun,mode)
%% 参数初始化
NumFeaOri = model.NumPerWin * model.NumWindow;
NumEnhOri = model.NumEnhance;
NumAddFea = model.NumAddFea;
Expand Down Expand Up @@ -35,11 +34,9 @@
AddDataOriEnhPDD = model.Beta(NumFeaOri+1:NumFeaOri+NumEnhOri,:);
AddDataOriEnhSel = SelTrainA(:,NumFeaOri+1:NumFeaOri+NumEnhOri);
end
% 选择结构
SelectNeruonSet = [];
if strcmp(mode,'AN') || model.AddNodeStep == 0
for z = 1:NumClass
%间接偏微分
if strcmp(sigfun,'logsig')
DiagAddEnhAll = AddEnhSel((z-1)*NumEech4SA+1:z*NumEech4SA,:) .*(1-AddEnhSel((z-1)*NumEech4SA+1:z*NumEech4SA,:));
try
Expand Down Expand Up @@ -77,14 +74,10 @@
end
model.AllPD{z} = [model.AllPD{z} ; AddFeaPD ; AddRelPDD ; AddEnhPDD];
end
%找到判断第z个类别最重要的节点
[~,Max_index] = max(model.AllPD{z},[],2);
Max_index_{z}=find(Max_index==z);
%找到所有单元对于第z个类别的重要性,并对其进行降序排列
AllPD_z = model.AllPD{z}(:,z) ;
[row_descend,index_temp] = sort(abs(AllPD_z),"descend");

%找到降序排列后,过起点和终点直线与降序直线的交点位置
[row_descend,index_temp] = sort(AllPD_z,"descend");
row_descend_line = sort(linspace(min(row_descend),max(row_descend),length(model.Beta(:,1))),'descend');
[~,ban_index] = min(abs(row_descend_line(2:end-1) - row_descend(2:end-1)'));
Expand Down Expand Up @@ -139,14 +132,10 @@
model.AllPD{z}(NumFeaOri+NumEnhOri+(NumAddFea+NumAddRel+NumAddRel)*(k-1)+1:NumFeaOri+NumEnhOri+(NumAddFea+NumAddRel+NumAddRel)*(k-1)+NumAddFea,:)...
= model.FeaPD{z}(NumFeaOri+NumAddFea*(k-1)+1:NumFeaOri+NumAddFea*k,:);
end
%找到判断第z个类别最重要的节点
[~,Max_index] = max(model.AllPD{z},[],2);
Max_index_{z}=find(Max_index==z);
%找到所有单元对于第z个类别的重要性,并对其进行降序排列
AllPD_z = model.AllPD{z}(:,z) ;
[row_descend,index_temp] = sort(AllPD_z,"descend");

%找到降序排列后,过起点和终点直线与降序直线的交点位置%
[row_descend,index_temp] = sort(AllPD_z,"descend");
row_descend_line = sort(linspace(min(row_descend),max(row_descend),length(model.Beta(:,1))),'descend');
[~,ban_index] = min(abs(row_descend_line(2:end-1) - row_descend(2:end-1)'));

Expand Down

0 comments on commit ecad244

Please # to comment.