- “arrayDatastore” documentation - https://www.mathworks.com/help/matlab/ref/matlab.io.datastore.arraydatastore.html.
- “combine” documentation - https://www.mathworks.com/help/matlab/ref/matlab.io.datastore.combine.html.
- “trainNetwork” documentation - https://www.mathworks.com/help/deeplearning/ref/trainnetwork.html.
- “trainnet” documentation - https://www.mathworks.com/help/deeplearning/ref/trainnet.html.
Multiple-input, single-output
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jesus Mª Juarez Ferreras
am 21 Mai 2024
Bearbeitet: Jesus Mª Juarez Ferreras
am 27 Mai 2024
Tengo un sistema MISO (plantmiso.mdl) de dos entradas y una salida, y no consigo su entrenamiento.
Cada vector de entrada tiene 100 números aleatorios del 1 al 100, al igual que el de salida. Como solo tengo un vector de salida he probado de varias maneras con el otro vector que tengo que incluir para que
system = trainNetwork(in,out,Networklayers,options);
no muestre error.
He puesto 100 ceros al principio o al final, 100 unos, he hallado la media y he puesto 100 valores con este número, etc.
¿Alguien sabe cómo podría entrenar dicho sistema con Matlab?
Gracias
I have a two-in, one-out MISO system (plantmiso.mdl), and I can't get it trained.
Each input vector has 100 random numbers from 1 to 100, just like the output. Since I only have one output vector, I have tried several ways with the other vector that I have to include so that
system = trainNetwork(in,out,Networklayers,options);
do not show error.
I have put 100 zeros at the beginning or end, 100 ones, I have found the average and I have put 100 values with this number, etc.
Does anyone know how I could train such a system with Matlab?
Thank you
0 Kommentare
Akzeptierte Antwort
Malay Agarwal
am 22 Mai 2024
I understand that you want to train a multi-input, single-output network using the “trainNetwork” function.
You can achieve this by combining the two input arrays and the output array into a single datastore and passing the combined datastore to the “trainNetwork” function.
Arrays can be converted to datastores using the “arrayDatastore” function. Each of the “arrayDatastore” objects can then be combined into a single datastore using the “combine” function. For example, if your input arrays are X1 and X2 and the output array is Y, you can try this:
X1Datastore = arrayDatastore(X1);
X2Datastore = arrayDatastore(X2);
labelDatastore = arrayDatastore(Y);
trainDatastore = combine(X1Datastore, X2Datastore, labelDatastore);
Once you have the combined datastore, you can pass it to the “trainNetwork” function as follows:
net = trainNetwork(trainDatastore, Networklayers,options);
You can also refer to the following link for a complete example on how to train multi-input networks: https://www.mathworks.com/help/deeplearning/ug/train-network-on-image-and-feature-data.html.
Please note that the example uses the “trainnet” function instead of the “trainNetwork” function since, starting with MATLAB R2024a, the “trainNetwork” function is not recommended. The “trainnet” function has certain advantages over “trainNetwork” which are mentioned here: https://www.mathworks.com/help/deeplearning/ref/trainnetwork.html#mw_868305a5-132e-4203-9214-860584bdcfdd.
Please refer to the following resources for further information:
Hope this helps!
3 Kommentare
Jesus Mª Juarez Ferreras
am 26 Mai 2024
Bearbeitet: Jesus Mª Juarez Ferreras
am 27 Mai 2024
Jesus Mª Juarez Ferreras
am 26 Mai 2024
Bearbeitet: Jesus Mª Juarez Ferreras
am 27 Mai 2024
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!