Why wont a seriesnetwork object compile in Simulink?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have trained a sequence to sequence LTSM deep classification network with the veiw of implementing it in simulink to classify EEG data coming in timesteps. The networks has the following layers and options shown in the below code. Im able to classify new data in matlab using classifyAndUpdateState(net,timestepdata) like shown in the code below.
However once I use the classify function inside a simulink program to classify new incoming data (coming in the same format as the trained network) the program wont compile as it does not recognise the net object. How can I get around this or alternatively how can I implement the trained LTSM net in Simulink. (obviously cant use gensim etc for a series network)
layers = [ ...
sequenceInputLayer(20)
bilstmLayer(100,'OutputMode','sequence')
bilstmLayer(100,'OutputMode','sequence')
bilstmLayer(100,'OutputMode','sequence')
bilstmLayer(100,'OutputMode','sequence')
fullyConnectedLayer(3)
softmaxLayer
classificationLayer
]
%%
options = trainingOptions('adam', ...
'MaxEpochs',300, ...
'InitialLearnRate', 0.01, ...
'GradientThreshold', 1, ...
'plots','training-progress', ...
'Verbose',false, ...
'ValidationData',{XTestReady,YTestReady}, ...
'ValidationFrequency',1);
%for classifying new data in timesteps
for i = 1:numTimeSteps
v = X(:,i);
[net,label,score] = classifyAndUpdateState(LTSMnet,v);
labels(i) = label;
end
1 Commento
Prajith Chilummula
il 11 Gen 2019
You can save the 'net' variable in a mat file and load the mat file in the MATLAB function and use the function as MATLAB function block.
Also please refer the below link:
https://www.mathworks.com/matlabcentral/answers/40701-using-workspace-data-in-matlab-function-block-simulink
Risposte (0)
Vedere anche
Categorie
Scopri di più su Sequence and Numeric Feature Data Workflows in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!