Neural network training - 2 input parameter to 1 output result training

2 次查看(过去 30 天)
im stuck at training net with 2 parameter.
right now im trying to clasify test data. by using example "Classify Text Data Using Deep Learning".
for that example if i want to have "description" and "category" as training input and "resolution" as target output.
which part of code in the example that i have to change.
i need help

采纳的回答

Madhav Thakker
Madhav Thakker 2020-9-8
编辑:Madhav Thakker 2020-9-8
Hi Ridza,
I understand that you want to train the LSTM network using description and category values instead of just description. As the preprocessText function, tokenization of input data is taking place. One simple way of training the network on both these values is to just prepend category data and continue with the procedure in the same way.
Note that you will have to change the target length of your training data by visualizing the histogram of the document length.
sequenceLength = %new Sequence Length;
XTrain = doc2sequence(enc,documentsTrain,'Length',sequenceLength);
Attaching code snippet for better explanation.
documentsTrain = preprocessText(dataTrain.Description + " " + dataTrain.Category);
documentsValidation = preprocessText(dataValidation.Description + " " + dataValidation.Category);
YTrain = categorical(dataTrain.Resolution);
YValidation = categorical(dataValidation.Resolution);
Refer this example for details -
Hope this helps.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Deep Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by