MATLAB Answers

Input Data format in deep learning

5 views (last 30 days)
Dianxin Luan
Dianxin Luan on 2 Jul 2020
Commented: Dianxin Luan on 25 Jul 2020
Hi,
I just want to set a feature vector (size is 256 * 1) as the input of DNN, which kind of layer should I use?
I saw there are only 4, imginput, img3dimput, sequenceinput, roilinput.
And If the output (label) is also a vector (size 252 * 1 and classification), what kind of data fromat should the label be? I saw from the instruction it's cell but there's always an error saying Invalid training data. The response must be a vector of categorical responses, or a cell array of categorical response sequences. Can you help me a little bit?
Thanks

  1 Comment

Dianxin Luan
Dianxin Luan on 2 Jul 2020
Sequence-to-sequence classification

Sign in to comment.

Answers (1)

Divya Gaddipati
Divya Gaddipati on 22 Jul 2020
Hi,
If you're doing a sequence-to-sequence classification, for the input layer, you have to use the sequenceInputLayer and for the output, you can use a classificationLayer.
You can refer to the following example on Sequence-to-sequence classification for more information:

  1 Comment

Dianxin Luan
Dianxin Luan on 25 Jul 2020
Yes, all the DNN classification examples is based on the scenario that input is image. Like what I posted the input is not image and I don't what to use RNN like LSTM to classify and I know it can work.
I also checked the trainNetwork page, and from that page it said 'For classification problems, Y is a categorical vector or a cell array of categorical sequences', which works for LSTM but not normal neorun network.
The error is 'Invalid training data. If the output of the network is a sequence, the response must be a cell array of a categorical sequence, or a categorical sequence', and the label used for training is categorical vector. If that is correct, why there's an error.
Can you upload some examples on that or some help?
Thanks

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!