How can I feed the outputs of a predict block back into its inputs?
6 次查看(过去 30 天)
显示 更早的评论
Hello all,
I would like to return the outputs of a Predict block to its input in Simulink. In the Predict block I use a neural network of type DLNetwork, which is forward directed (not recursive). As input format I use 'CT'. The network expects 5 inputs and gives 2 outputs. If I do not feed back the inputs, everything works. Here is a minimal example:

But when I feed back the inputs, I get the following error messages:

- Layer 'Input': Invalid input data. Invalid size of channel dimension. Layer expects input with channel dimension size 5 but received input with size 1. Function 'Predict1/MLFB' (#1113.64.309), line 2, column 19: "deep.blocks.internal.deepNetwork({in_1}, {size(in_1)}, {class(in_1)}, coder.cons" Launch diagnostic report.
- 'untitled1/Predict1/MLFB' or the model referenced by it contains a block that updates persistent or state variables while computing outputs and is not supported in an algebraic loop. It is in an algebraic loop with the following blocks.
How do I manage in Simulink to return the outputs of the Predict block without getting an error?
Many thanks in advance.
3 个评论
Purvaja
2025-8-28
Since you are feeding the signals back into the input, the model cannot determine whether the signals are instantaneous or when they should be processed relative to other steps. I recommend using a Unit Delay or Memory block to break the resulting algebraic loop.
I attempted to replicate your model, but encountered several errors. It would be very helpful if you could provide the .slx model file, the neural network, and the specific block parameters you have configured.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!