How to send values to workspace during reinforcement agent validation for further plot and analysis. Using "RUN" button on Simulink produces some difference from Validation.
    4 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Bay Jay
 il 7 Feb 2023
  
    
    
    
    
    Modificato: Emmanouil Tzorakoleftherakis
    
 il 13 Feb 2023
            I want to export specific values  to workspace during the Agent validation to plot. I donot want to use the Simulink "RUN" button. 
Reason: When I use the validate approach, the final value of a parameter is usually slightly different  when I run the simulink using the "RUN" button. The different is significant to my analysis. Using the "ToWorkspace" does not ouput anything when I execute  the validation script below. "ToWorkspace" only works when I use "RUN" on simulink. I want to get values to workspace during validation.
simOpts = rlSimulationOptions(MaxSteps=ceil(Tf/Ts),StopOnError="on");
experiences = sim(env,agent,simOpts);
0 Commenti
Risposta accettata
  Emmanouil Tzorakoleftherakis
    
 il 7 Feb 2023
        
      Modificato: Emmanouil Tzorakoleftherakis
    
 il 7 Feb 2023
  
      Hello,
First, to answer your point about the simulation differences between using the "Play" button vs using the "sim" command from Reinforcement Learning Toolbox:
1) The "sim" command will first run the 'reset' function that you have specified. Using the 'Play' button will not. That means that if you have any randomization in your reset function, for example changing the initial condition of your model, then seeing different results is expected.
2) Not sure which agent you are using, but some agents are stochastic. So even if you run the same simulation multiple times, unless you fix the random seed you will see different results.
For your second question on logging data to workspace when using the sim command: I just tested it myself and was able to get the data on my workspace. The main difference is that when you use the 'sim' command, the variables from 'ToWorkspace' block will be saved inside the experiences struct (output of sim), not directly in your workspace. If that's not the case, I would check whether the model simulates without error.
Hope this helps
2 Commenti
  Emmanouil Tzorakoleftherakis
    
 il 13 Feb 2023
				
      Modificato: Emmanouil Tzorakoleftherakis
    
 il 13 Feb 2023
  
			Which makes sense since DDPG is deterministic. Please accept the answer if the issue has been resolved
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Deep Learning Toolbox in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!