Using "seriesnetwork" type trained network in Simulink with the "Predict" block.

3 次查看(过去 30 天)
Hello,
I have trained this 2-layer network for regression using MATLAB's trainNetwork function. It takes 3 feature inputs and has 1 output. It works just fine in MATLAB(with the "predict" function), but I need to use the "seriesnetwork" type trained NN in Simulink. I have saved the network as a ".mat" file and tried to use it with the predict block in Simulink, but I can't get past the
"Invalid size specification for the input to the predict method. The network input must have feature dimension 3."
error. I feed the 3 input features to the network as a 3-by-1 column vector like the documentation suggests; however, I simply could not make it work. Has anyone faced a similar issue? Can anyone help me out with this?
Thank you.

回答(1 个)

Srivardhan Gadila
Srivardhan Gadila 2021-10-6
As per the documentation of Predict block, the input for feature type of data should be of the shape "N-by-numFeatures" numeric array, where N is the number of observations and numFeatures is the number of features of the input data. Hence in this case it shoul be of shape 1-by-3 for a single observation.
Refer to the description under "Input" in the documentation of Predict block.

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by