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

5 ビュー (過去 30 日間)
Y. M
Y. M 2020 年 12 月 4 日
編集済み: Y. M 2020 年 12 月 4 日
強化学習を行う中、
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エピソード目の結果しか出力されないようです。

回答 (0 件)

カテゴリ

Help Center および File ExchangeTraining and Simulation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!