Matrices as input and target for a neural network: "Number of inputs does not match net.numInputs."

1 次查看(过去 30 天)
I'm attempting to train a neural network with a 425x12273 uint8 matrix as the network input, and a 1x12273 uint8 matrix as the network target. I have 12273 training examples and correct outputs stored in these matrices (the first and second ones, respectively). The neural network I've created takes in 425 inputs and ultimately outputs a single value.
When attempting to run (where X is 425x12273, T is 1x12273)
[net,tr] = train(net,X,T)
I get the error "Number of inputs does not match net.numInputs." How can I use these matrices as proper inputs to the network?
Note: I have tried
X = num2cell(X, 1)
T = num2cell(T, 1)
in order to get these matrices into cell array format; the error persists.

回答(1 个)

MUHAMMED IRFAN
MUHAMMED IRFAN 2018-6-14
Hello, Are you trying to attempt a classification problem ?? If so..
As I can understand , you are trying to train some 12273 elements , each of them are defined by their 425 features. You haven't mentioned in the question how many classes you want to classify them into .
You have just mentioned "correct outputs stored in these matrices (the first and second ones, respectively)". If you are trying to classify into 2 classes, your target should be og size 2 * 12273 instead of 1 * 12273 , each row corresponding to their respective classes.

产品


版本

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by