problem with reinforcment learning agent

7 次查看(过去 30 天)
I am trying to write a RL agent for a parameter on helicopter control (the details are g iven if it is necessary.) problem is that I keep getting the error given below. I have read all the helps and RL agent documents but I have no idea how to fix it. The codes are given in the attachments.
Error using rl.env.AbstractEnv/simWithPolicy (line 70)
An error occurred while simulating "slidingmodehover" with the agent
"rl.util.PolicyInstance.get()".
Error in rl.task.SeriesTrainTask/runImpl (line 33)
[varargout{1},varargout{2}] =
simWithPolicy(this.Env,this.Agent,simOpts);
Error in rl.task.Task/run (line 21)
[varargout{1:nargout}] = runImpl(this);
Error in rl.task.TaskSpec/internal_run (line 159)
[varargout{1:nargout}] = run(task);
Error in rl.task.TaskSpec/runDirect (line 163)
[this.Outputs{1:getNumOutputs(this)}] = internal_run(this);
Error in rl.task.TaskSpec/runScalarTask (line 187)
runDirect(this);
Error in rl.task.TaskSpec/run (line 69)
runScalarTask(task);
Error in rl.train.SeriesTrainer/run (line 24)
run(seriestaskspec);
Error in rl.train.TrainingManager/train (line 291)
run(trainer);
Error in rl.train.TrainingManager/run (line 160)
train(this);
Error in rl.agent.AbstractAgent/train (line 54)
TrainingStatistics = run(trainMgr);
Error in slidingmodeddpg (line 148)
trainingResults = train(agent,env,trainingOptions)
Caused by:
Error using rl.env.SimulinkEnvWithAgent>localHandleSimoutErrors (line
689)
Simulink cannot solve the algebraic loop containing 'slidingmodehover/RL
Agent/AgentWrapper' at time 0.05 using the TrustRegion-based algorithm
due to one of the following reasons: the model is ill-defined i.e., the
system equations do not have a solution; or the nonlinear equation solver
failed to converge due to numerical issues.
To rule out solver convergence as the cause of this error, follow either
of the suggested actions. If the error persists in spite of the
following changes, then the model is likely ill-defined and requires
modification.
  1 个评论
Emmanouil Tzorakoleftherakis
Hello,
I cannot reproducre the error because some files are missing I believe, but I would focus on the algebraic loop mentioned towards the end of the error. Maybe add some delay blocks in the loops around the RL Agent block to see if that resolves the error

请先登录,再进行评论。

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by