Input image data directly from Variable and not DataStore?

I've got neural data that I'm using to create the 'images' for a CNN model. I have a 4 dimensional array where the first 3 dimensions are the X,Y,RGB values, and the 4th is the image index (ex 1:107,000). Can I port this directly into Matlab's CNN models? So far I have to use the data to create PNGs in test/train folders, then import using the example from 'Create simple Deep Learning Network...' provided by Matlab's documentation, but it would be so much more efficient to pipe the data directly.

 Respuesta aceptada

Travis Meyer
Travis Meyer el 2 de Oct. de 2022
Got it!!! It's actually easier than expected, I can pass the 4D array directly into trainNetwork, even without using arraydatastore. I typed 'edit trainNetwork' and read through the comments and this one explained a good amount of the steps:
% trainedNet = trainNetwork(X, Y, layers, options) trains and returns a
% network, trainedNet. The format of X depends on the input layer.
% - For an image input layer, X is a numeric array of images arranged
% so that the first three dimensions are the width, height and
% channels, and the last dimension indexes the individual images.
% - For a 3-D image input layer, X is a numeric array of 3-D images
% with the dimensions width, height, depth, channels, and the last
% dimension indexes the individual observations.

Categorías

Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.

Productos

Versión

R2021b

Etiquetas

Preguntada:

el 1 de Oct. de 2022

Respondida:

el 2 de Oct. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by