using datastores for two inputs to trainnet

62 visualizaciones (últimos 30 días)
Mark Hubelbank
Mark Hubelbank el 14 de Dic. de 2024 a las 0:28
Respondida: Gayathri el 24 de Dic. de 2024 a las 6:08
We are trying to use datastores as input to trainnet. The data consists of cells in the form of 3x90 arrays of doubles and the labels which are simple one character strings. The structure of the program is:
clabels=categorical(labels,["A" "N" "V" "S" "F" "U"]);
datastoreclabels=arrayDatastore(clabels);
data=cell(numSets,1);
for i =1:numSets
data(i)= 3x90 array of double
end
datastoredata=arrayDatastore(data);
datastoredataF=combine(datastoredata,datastoreclabels);
net=trainnet(datastoredataF,layers,"crossentropy",options);
and got the error below, but note that
net=trainnet(data,clabels,layers,"crossentropy",options);
did work.
The error was:
Error using trainnet (line 54)
Error forming mini-batch for network input "sequenceinput". Data interpreted with format "SCTB". To specify a different format, use the InputDataFormats option.
I am assuming that this was because the conversion from clabels to datastoreclables was incorrect but I don't see a better way.
Can anyone suggest what is missing?
  3 comentarios
Mark Hubelbank
Mark Hubelbank el 15 de Dic. de 2024 a las 14:02
The raw data is the analog output from three sensors. It was sampled generating 90 values for each sensor so the result is an array of data with the dimension of 3x90. The "labels" are the manually created "true" labels that we would like the network to ultimately produce. A datastore is being used because once this works, more data from other sensors in a different format will be added.
Jayanti
Jayanti el 16 de Dic. de 2024 a las 19:16
Can you please provide the complete code (including model architecture) and data you used, so that I can reproduce the issue?

Iniciar sesión para comentar.

Respuestas (1)

Gayathri
Gayathri el 24 de Dic. de 2024 a las 6:08
Please refer to the following answer which solves a similar issue as mentioned in the question.
I can assist you better once you provide the complete code.
Hope this helps!

Categorías

Más información sobre Image Data Workflows en Help Center y File Exchange.

Productos


Versión

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by