How to do Pattern Recognition with 3D input data using Deep Learning Toolbox?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 7 de Mzo. de 2018
Editada: MathWorks Support Team
el 2 de Sept. de 2021
If I have elements of 2D data that are put into a 3D inputs variable, is it possible to do pattern recognition on this data in MATLAB?
>> inputs = rand(3,3,10);
>> targets = ones(2,10);
>> net = patternnet(10);
>> net = train(net, inputs, targets) %error inputs must be 2D
>> nprtool %dropdown does not give 3D inputs variable as an option
Respuesta aceptada
MathWorks Support Team
el 31 de Ag. de 2021
Editada: MathWorks Support Team
el 2 de Sept. de 2021
The input data for training classical neural networks is expected to be an R x Q dimensional matrix (or a cell array of R x Q matrices), where Q is the batch size or number of observations and R is the number of variables.
Since ‘patternnets’ (in general, not just in MATLAB) do not take account of spatial dependencies between variables (as opposed to convolutional deep learning networks) you could try to work around this requirement by reshaping the data from a 2D matrix into a 1D vector. For example:
Instead of:
inputs = rand(3,3,10)
targets = ones(2,10);
You could use:
inputs = rand(9,10);
targets = ones(2,10);
However, depending on what your 2-D data represents, a better alternative might be to work with convolutional neural networks (CNNs). These networks are designed to model spatial dependencies between variables/features and are state-of-the-art for tasks such as image classification.
Please see here how to create a simple classification deep learning network for 2-D image data:
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!