How do I set initial condition for a trained Reinforcement Learning agent (RL Agent)?

I have a trained Reinforcement Learning (RL) agent that I want to apply as a controller of a tank. Actually it is the same as the MATLAB example "Create Simulink Environment and Train Agent", which controls a Water Tank. I have modified the reward function and some other criterias. Now it is trained and working well, although I cannot change the initial action of the agent. It is causing problems because it initiates with an incorrect action.
In the PID block, for example, I can set the initialization parameter and make the controller initial in steady state, but I cannot do the same for RL agent.
Can anyone help with it?

5 Comments

unfortunately I am not able to answer your question, as matter of fact I have a very similar problem! were you able to figure out a solution? If yes, how?
I found a work around. I set the initial conditions always to be the same during the training, and in some instant of the training I apply a disturbance or a change of setpoint. So the agent learns to start always from the same point. I am not sure if it is the best solution, but it worked for me.
Could you please comment on how did you set the initial condition of actions from the code ?
Thank you.
I could not set initial conditions, I just set the training enviroment to start always with the same conditions.
@Abraao Tanan Thank you for your answer. This approach could work depending on the type of application. For me, I am looking for a more generic way of initializing it. I don't know why python is able to do it but not MATLAB.

Sign in to comment.

Answers (0)

Categories

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

Products

Release

R2019b

Asked:

on 4 Jul 2021

Commented:

on 29 May 2023

Community Treasure Hunt

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

Start Hunting!