?? competitive_modifikasi.m
字號:
% The man makes brain
% Glanny Mangindaan 2206201005
% Program Magister Teknik Elektro Pasca-sarjana
% Institut Teknologi Sepuluh Nopember Surabaya
% =======================================
% Counterpropagation neural network
% Kendali Dynamic Voltage Restorer menggunakan
% Jaring Saraf Tiruan Counterpropagation
% Using Matlab (2007b) ver 7.5
%
clc;
%% input dan target
simoutdp;
simoutdi;
p=simoutdp';
t=simoutdi';
%%
%Pembuatan struktur jaringan
Ts=5e-6;
P=p/norm(p);
T=t/norm(t);
net=newcpnn([0,1],[0,1],[8,4],{'logsig','compet','purelin'},'trainlm','learngd');
net.layerWeights{2,1}.weightFcn='normprod';
net.layerWeights{3,2}.weightFcn='normprod';
net.layers{1}.distanceFcn='dist';
net.layers{2}.distanceFcn='dist';
net.layers{3}.distanceFcn='dist';
net.layers{1}.topologyFcn='gridtop'; % Topologi lapis 1
net.layers{2}.topologyFcn='gridtop'; % Topologi lapis 2
net.layers{3}.topologyFcn='gridtop'; % Topologi lapis 3
net.inputs{1}.processFcns={'mapstd'};
net.outputs{3}.processFcns={'mapstd'};
net.inputConnect=[1;0;1];
net.trainParam.lr=0.9;
net.trainParam.epochs=1000; %Jumlah epochs maksimum untuk di train
net.trainParam.goal=1e-6; %Performance goal
net.trainParam.show=25; %Epochs yang ditampilkan
net.trainParam.time=inf; %Waktu maksimum untuk di train dalam detik
net=init(net);
[Y,Pf,Af,e,perf]=sim(net,P,[],[],T);
[net,tr,Y,E]=train(net,P,T);
[net,Y,E,Pf,Af,tr]=adapt(net,P,T);
% pos=gridtop([1,2],[1,1],0.2); plotsom(pos)
% hold on;
plot(Y,'*b')
hold on
plot(T,'og')
hold on
%plot(P,'+r')
%hold on
gensim(net,Ts)
%
weight11=net.IW{1,1}
bias1=net.b{1}
weight21=net.LW{2,1}
bias2=net.b{2}
weight32=net.Lw{3,2}
weight31=net.IW{3,1}
bias3=net.b{3}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -