?? fitness.m
字號:
function fitnessdegree = fitness(chronom)
[r, length] = size(chronom);
hide = fix(length / 7);
% load training data set
load xl.txt
% -------------------------------------------------------------------------
xl_Input = xl(:, 1:5)';
xl_Target = xl(:, 6)';
clear xl
% Normalize these data set for network training and simulation
[xl_Input_norm, ps] = mapminmax(xl_Input);
[xl_Target_norm, ts] = mapminmax(xl_Target);
% create a neural network to capture the relationship between the Input and
% the Target
net = newff(minmax(xl_Input_norm), [hide, 1], {'tansig' 'purelin'}, 'trainlm');
[Iw, Lw, b] = decode(chronom);
net.IW = Iw;
net.LW = Lw;
net.b = b;
xl_Output_norm = sim(net, xl_Input_norm);
fitnessdegree = sum((xl_Output_norm - xl_Target_norm).^2);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -