Question

Firstly - this is how my data looks :

in1 = [a vector of [5189,1]]
in2 = [a vector of [5189,1]]
in3 = [a vector of [5189,1]]

out = [a vector of [5189,1]]

What I'm trying to do is predict the output using the 3 inputs/

Now, I've been training a radial basis network doing the follow steps :

net = newrbe([in1';in2';in3'], out', 100);

And then obtaining the predictions using a testing set with the sim function. Firstly, is this the correct way to do what I am supposed to be doing? I'm getting a good answer / prediction, hence I assumed it is fine.

Now, I wanted to train a recurrent neural network using the same methodology. I did the following as per the manual at : http://www.mathworks.com/help/nnet/ref/layrecnet.html

So ,

net = layrecnet(1:2,100);

and then I simply did [Xs,Xi,Ai,Ts] = preparets(net,X,C);

where X = [in1';in2';in3'] and C = out';

And I got the error :

Error using vertcat
Dimensions of matrices being concatenated are not consistent.

Hence, using the answer at "Index Exceeds Matrix Dimensions" neural network function error

I did X = num2cell([in1',in2',in3']); and C = num2cell(out');

And then tried the preparets function again to get :

Error using preparets (line 161)
The number of input signals does not match network's non-feedback inputs.

OR

Error using network/train (line 293)
Number of inputs does not match net.numInputs.

Can someone teach / explain to me just how should I get this thing done? I have a decent idea of what a recurrent neural network is, however this problem seems to be a matlab problem. Please tell me just how should I give the inputs / feedbacks etc? Thank you very much!

Was it helpful?

Solution

For layrecnet and others neural networks that demands cell input format, you can use the command con2seq(in) and con2seq(out) [no mater the dimension of the vectors in and out]. This command will convert you input NxM in a 1xM cell arrange or so.

Reference: http://www.mathworks.com/help/nnet/ref/con2seq.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top