请问最后的那组数据如何实现归一化。
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
P=[200 250 300 330 200 200 220 300
200 200 150 180 200 200 200 200
4 4 4 4 2 1 0.7 0.7
0.3 0.3 0.3 0.3 0.2 0.2 0.15 0.15];
T=[245 260 220 250 220 215 205 230];
[Pn,minp,maxp,Tn,mint,maxt]=premnmx(P,T)
net=newff(minmax(P),[8,1],{'tansig','logsig'},'trainlm');
net=init(net);
net.trainparam.epochs=20000; %最大训练次数(前缺省为10,自trainrp后,缺省为100)
net.trainparam.lr=0.05; %学习率(缺省为0.01)
net.trainparam.show=25; %限时训练迭代过程(NaN表示不显示,缺省为25)
net.trainparam.goal=1e-8; %训练要求精度(缺省为0)
net.trainparam.max_fail=15 %最大失败次数(缺省为5)
%net.trainparam.min_grad 最小梯度要求(前缺省为1e-10,自trainrp后,缺省为1e-6)
%net.trainparam.time 最大训练时间(缺省为inf)
[net,tr]=train(net,Pn,Tn); %网络训练
V = net.iw{1,1}%输入层到中间层权值
theta1 = net.b{1}%中间层各神经元阈值
W = net.lw{2,1}%中间层到输出层权值
theta2 = net.b{2}%输出层各神经元阈值
A=[210
180
3
0.25];
result=sim(net,A)
就是前面的P和T实现了归一化,那么预测数据A呢?怎么实现归一化?
0 commentaires
Réponse acceptée
xiyiyaj
le 22 Nov 2022
可以用tramnmx函数,给你写了个例子供参考:
%% 清空环境变量
close all; clear; clc;
%% 主程序
P=[200 250 300 330 200 200 220 300
200 200 150 180 200 200 200 200
4 4 4 4 2 1 0.7 0.7
0.3 0.3 0.3 0.3 0.2 0.2 0.15 0.15];
T=[245 260 220 250 220 215 205 230];
[Pn,minp,maxp,Tn,mint,maxt]=premnmx(P,T);
A=[210
180
3
0.25];
p2= tramnmx(A,minp,maxp);
p2就是归一化之后的向量
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!