How can I make a RBF NN with multiple inputs and a single input
3 次查看(过去 30 天)
显示 更早的评论
Hello, I'd like to creat a RBF with 'newrb' function,
My inputs are 3 columns with 1000 elements each, and my output is a single column with 1000 elements.
But when I try to creat I get the following error 'Inner matrix dimensions must agree'
Thank you
0 个评论
回答(1 个)
nick
2024-10-8
编辑:nick
2024-10-8
Hi Bruno,
The error “Inner matrix dimensions must agree” seems to indciate a mismatch in the dimensions of the matrices involved in an operation. Kindly ensure that the input data and the output data are in the correct format. The 'newrb' function expects the input matrix P to have dimensions [R x Q], where R is the number of input features (3 in your case) and Q is the number of samples (1000 in your case). The target matrix T should have dimensions [S x Q], where S is the number of output features (1 in your case) and Q is the number of samples (1000 in your case).
Here’s a sample code to create an RBF network with the inputs and outputs of the specified dimensions:
% Sample input data (3 columns, 1000 rows)
P = rand(3, 1000);
% Sample output data (1 column, 1000 rows)
T = rand(1, 1000);
% Ensure data is in the correct format
if size(P, 1) ~= 3
P = P';
end
if size(T, 1) ~= 1
T = T';
end
net = newrb(P, T);
view(net);
You can refer to the documentation of the function 'newrb' using the following command in MATLAB Command Window:
doc newrb
Hope this helps to resolve the issue.
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!