強化学習の報酬等をファイルに出力

2 Ansichten (letzte 30 Tage)
Y. M
Y. M am 4 Dez. 2020
Bearbeitet: Y. M am 4 Dez. 2020
強化学習を行う中、
1エピソード毎に報酬やステップ数といったデータを
ファイルに出力したいのですが可能でしょうか。
trainingOptions = rlTrainingOptions(...
'MaxEpisodes',500,...
'MaxStepsPerEpisode',9490,...
'ScoreAveragingWindowLength',20,...
'Verbose',true,...
'Plots',"none",... %training-progress
'StopTrainingValue',500,...
'StopTrainingCriteria',"EpisodeCount",...
'SaveAgentValue',50,...
'SaveAgentCriteria',"EpisodeCount",...
'SaveAgentDirectory',"savedAgents");
doTraining=true;
if doTraining
trainingStats = train(agent,env,trainingOptions);
reward_per_episode=trainingStats.EpisodeReward;
steps_per_episode=trainingStats.Episodesteps;
Q0=trainingStats.EpisodeQ0;
dlmwrite(strcat(path,'results\reward.csv'),reward_per_episode,'-append');
dlmwrite(strcat(path,'results\steps.csv'),steps_per_episode,'-append');
dlmwrite(strcat(path,'results\Q0.csv'),Q0,'-append');
現在上記のようなコードを書いているのですが、
このままだと500エピソード目の結果しか出力されないようです。

Antworten (0)

Kategorien

Mehr zu 時系列コレクション finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!