Why is there a error message that says the numbers of input signals and networks inputs do not match?
13 次查看(过去 30 天)
显示 更早的评论
Below is a copy of my code and I couldn't manage to get it to configure properly because of the error message. When I run the code it says the numbers of input signals and networks inputs do not match. Some help much appreciated.
x = linspace(0,10,100);
z1 = [0.001 1 1.5 2 2.335 2.5 3 4 5 6 7 8 10];
invx = 1./x;
invz = 1./z1;
z = [z1;invz];
t = Mg(z1,invz);
net = feedforwardnet;
net.numinputs = 2;
net.numLayers = 1;
net.inputConnect = [1 1];
net = configure(net,z,t);
NOTE: Mg is a separate file of some function of R and inverse R.
Thank you Greg for the comment, I apologise for the error, below is a copy of Mg.m file.
function value = Mg(r,inverseR)
B = 3.82045;
b = 1.31633;
beta = 2.17316;
C = -0.19641;
Rc = 2.30156;
c = 0.61347;
gamma = 1.79411;
D = 0.00082;
Rd = 1.83495;
d = 0.74887;
delta = 1.86846;
value = (-2.*inverseR).*(tanh(r)) + B.*(exp(-(r./b).^beta)) + C.*(exp(-(abs((r-Rc)./c).^gamma))) + D.*(exp(-(abs((r-Rd)./d).^delta)));
end
1 个评论
回答(1 个)
Greg Heath
2018-12-19
编辑:KSSV
2022-10-17
See my attachment
Note that typically, all you have to define is the input and target.
Use of CONFIGURE is UNNECESSARY
It can be as simple as this
See HELP FITNET
[ x, t ] = simplefit_dataset;
[ net tr y e ] = train( fitnet ,x, t );
MSE = mse(e)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!