Adaptive Neural Network Simulink

how to make the NN that I just created adaptive on Simulink, like it should adjust the weights and biases online? should I use the my precreated neural network and use the genfunction code, and add the adapt function to it? I created the NN using the nntool and exported it to Simulink, but it seems that I cannot control the weights and biases of it anymore, I am very confused I'll appreciate any help thank you

 Accepted Answer

HI Hassan,
We do have some informationon incremental learning from MATLAB here: Incremental Learning Overview. But I understand your question is related to Simulink.
For Simulink, incremental learning offers some challenges, so I have some follow up questions for you:
  • How often are you wanting to update the neural network model in Simulink?
  • How long did the original NN take to train?
  • Have your identifies any scenarios where you would trigger a retraining of the NN model?

3 Comments

Hi David,
Thanks for the answer, I really appreciate it,
so first I created a feedforward NN and trained it with the inputs and outputs of a PI controller (curve fitting), it took around 20-30 min, then I replaced the PI controller with it, and it gave a pretty decent results, but what I want to do is to create a NN and add it in parallel to a PI controller so that the NN adapt and adjusts the gains of the PI to give a better results than the NN,
so I just want to know how to implement the adaptive NN on simulink that use the Incremental/Online learning, is it by creating a NN and using the adapt function in a MATLAB function block on Simulink, or this is not the way?
To be more clear is the adapt function use the precreated NN and adjusts its weights and biases online? or there is something that I am missing? because I don't have that strong deep learning background.
Hi Hassan,
I'd probably recommend using Reinforcement learning for the problem you describe. This example, Tune PI Controller using Reinforcement Learning, shows how to tune a PI controller. In RL, there is an agent that "learns" via simulation how to improve and what it learns is stored in deep learning network.
Is Reinforcement Learning something you'd consider for your application?
Hi David,
Sorry for late reply but I am having some technical problems with my laptop.
Concerning your proposal of using reinforcement learning, I don't think that I need it, because I am required to go with certain obligations lets say, and RL is not one of them, and the reality is that I don't have enought information about it.
What I am trying to implement is just a SISO NN that takes the error of a reference (constant) compared to the actual value , and the ouput of the NN is added to a PI controller in a way the NN adapt and learn to tune the PI response.
The thing is that I havent found a way to implement this system because it requires online learning(I managed to do it with offline/batch training), but my question was about the adapt function because it seems that this is way to go with.
Anyway I thank you for your time and answers, I appreciate it a lot and if you have any thing you can help me with the adapt function(example or so) I'll be thankfull a lot.

Sign in to comment.

More Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Products

Release

R2021b

Community Treasure Hunt

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

Start Hunting!