1
votes

In my undergrad thesis I am creating a neural network to control automated shifting algorithm for a vehicle.

I have created the nn from scratch starting from .m script which works correctly. I tested it to recognize some shapes.

A brief background information;

NN rewires neurons which are mathematical blocks located in a layer. There are multiple layers. output of a layer is input of preceding layer. Actual output is subtracted from known output and error is obtained by this manner. By using back propagation algorithm which are some algebraic equation the coefficient of neurons are updated.

What I want to do is;

in code there are 6 input matrices, don't have to be matrix just anything and corresponding outputs. lets call them as x(i) matrices and y(i) vectors. In for loop I go through each matrix and vector to teach the network. Finally by using last known updated coeffs networks give some responses according to unknown input.

I couldn't find the way that, how to simulate that for loop in simulink to go through each different input and output pairs. When the network is done with one pair it should change the input and compare with corresponding output then update the coefficient matrices.

I model the layers as given and just fed with one input but I need multiple. enter image description here When it comes to automatic transmission control issue it should do all this real time. It should continuously read the output and updates the coeffs and gives the decision.

1
Is there a specific reason not to use the recommended work flow? That would be training in matlab, then generate a simulink block for the neuronal network.Daniel
What did you mean saying the recomended workflow?freezer
Hello, @freezer. Have you resolved your issue? I'm facing a kind of similar one: stackoverflow.com/questions/64534207/… May be you have an answer?Victoria

1 Answers

2
votes

Check out the "For each Subsystem". Exists since 2011b

To create the input signals you use the "Concatenate" Block which would have six inputs in your case, and a three dimensional output x.dim = [1x20x6] then you could iterate over the third dimension...

A very useful pattern to create smaller models that run faster and to keep your code DRY (Dont repeat yourself)