Multiple Inputs for Neural Network binary classification (Error Input/Target of different numbers of samples)
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Wookie
el 21 de Mzo. de 2022
Respondida: Wookie
el 22 de Mzo. de 2022
Hi,
I cannot seem to get the following code to run with 3 matrix inputs (IN_1, IN_2, IN_3) and binary output (0, 1). Each of the input matrix is 30,000 x 2,000 where the row is my input/signal. Below is what I have:
x = 3 x 1 cell of 30,000 x 2000
t = 1 x 30,000
Error using network/train (line 347)
Inputs and targets have different numbers of samples.
[net,tr] = train(net,x,t);
Below is what I have:
% Solve a Pattern Recognition Problem with a Neural Network
% Script generated by Neural Pattern Recognition app
inputData = {IN_1, IN_2, IN_3};
x = inputData';
t = target';
% Choose a Training Function
% For a list of all training functions type: help nntrain
% 'trainlm' is usually fastest.
% 'trainbr' takes longer but may be better for challenging problems.
% 'trainscg' uses less memory. Suitable in low memory situations.
trainFcn = 'traincgf'; % Scaled conjugate gradient backpropagation. traincgf
% Create a Pattern Recognition Network
hiddenLayerSize = 50;
net = patternnet(hiddenLayerSize, trainFcn);
net.numinputs = 3;
net = configure(net,x);
net.inputConnect = [1 1 1; 0 0 0];
% Train the Network
[net,tr] = train(net,x,t);
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Sequence and Numeric Feature Data Workflows en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!