How to implement SeriesNetwork in Simulink (Deep Learning)

I followed this youtube video to implement a neural network trained using trainNetwork in simulink.
The neural network takes in a 1x13 vector and ouputs a 1x13 vector (It is meant to be an autoencoder). There is a zero hold block with a sample time of 20s.
Following the predict block method, I got this size mismatch error.
Following the MATLAB function implementation,
function reg = output(u)
persistent network;
if isempty(network)
network = coder.loadDeepLearningNetwork('autoenc.mat','myautoenc');
end
reg = network.predict(u');
end
I get this error:
How do I fix this?

回答 (1 件)

Krishna
Krishna 2024 年 5 月 30 日

0 投票

Hey Patrick,
Given that you're working on modeling a series network, I'm under the impression you're employing a Recurrent Network. It might be more effective to utilize a stateful predict rather than the regular predict block. This is because stateful predict blocks are specifically designed to handle sequence information in the time domain, which is a key characteristic of recurrent networks.
Please go through the following documentation to learn more,
Hope this helps.

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

質問済み:

2021 年 2 月 18 日

回答済み:

2024 年 5 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by