Sending episode number to simulink during training
15 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Esan freedom
le 24 Jan 2023
Modifié(e) : Emmanouil Tzorakoleftherakis
le 25 Jan 2023
Hello every one,
I am using reinforcement learning with two agents and I am going to laod the number of episode from workspace in simulink by "from workspace block". I tried trainingStats.EpisodeIndex(1) but I recieved error. As trainingStats would appear after terminating episode 1, I dont have any idea to find the episode number in simulink.
I would appreciate any help.
3 commentaires
Benjamin Thompson
le 24 Jan 2023
Can you provide a listing of the error message and more examples of what you are doing and how you are doing it?
Réponse acceptée
Emmanouil Tzorakoleftherakis
le 24 Jan 2023
Modifié(e) : Emmanouil Tzorakoleftherakis
le 24 Jan 2023
The training stats are not available until after training is done, so you cannot use trainingStats.EpisodeIndex during training. The easiest way to accomplish what you want is by using the reset function. Take a look at this example.
The reset function is called before every episode, so you can use it to create a counter for the episode number and assign it either to a workspace variable, or directly to e.g. a Constant block in Simulink.
Hope that helps
4 commentaires
Emmanouil Tzorakoleftherakis
le 25 Jan 2023
Modifié(e) : Emmanouil Tzorakoleftherakis
le 25 Jan 2023
Glad it was helpful
Plus de réponses (1)
Fangjun Jiang
le 24 Jan 2023
Try the Constant block and specify the value as trainingStats.EpisodeIndex(1). Read the document of the "From Workspace" block to see if it is what you needed.
Voir également
Catégories
En savoir plus sur Training and Simulation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!