In Deep Learning Toolbox, we can use imageInputLayer() and imageDatastore() for image-type input.
How about the simplest type of input: the dataframe (say an array)?
Which input layer should we use? Should we use datastore() for this type of input?
I don't see many tutorial about this type of input and I got error for the below code. Each of my data point contains 2 features (i.e. size 2x1x1), but when Matlab read the data store, it can only read 1 feature (i.e. 1x1x1).
Failed code
Error message: The training images are of size 1x1x1 but the input layer expects images of size 2x1x1.
data=[ ...
-0.4 -0.8; ...
-1.4 -1.0; ...
-1.5 -1.7; ...
-2.3 -2.0; ...
-1.2 -1.1; ...
];
csvwrite('data.csv',data);
ds_features = datastore('data.csv');
layers = [
imageInputLayer([2 1 1],'Name','in')
fullyConnectedLayer(10,'Name','fc1')
softmaxLayer('Name','sm1')
classificationLayer('Name','cf1')];
lgraph = layerGraph(layers);
options = trainingOptions('sgdm', ...
'MaxEpochs',4, ...
'Verbose',false, ...
'Plots','training-progress');
net = trainNetwork(ds_features,layers,options);
0 Comments
Sign in to comment.