Use trained RL agent to predit output on random test sample

29 ビュー (過去 30 日間)
Praveen Verma
Praveen Verma 2024 年 11 月 19 日 0:37
コメント済み: Hitesh 2024 年 11 月 19 日 5:52
This is my code
Required_agent=load('G1_Agents.mat', 'agent1', 'agent2','agent3');
test_sample=final_test_data_rearranged;
final_test_sample = reshape(test_sample, [], 1);
fprintf('Required_sample = %d\n', i)
agent1 = Required_agent.agent1;
agent2 = Required_agent.agent2;
agent3 = Required_agent.agent3;
policy1=generatePolicyFunction(agent1);
policy2=generatePolicyFunction(agent2);
policy3=generatePolicyFunction(agent3);
action1 = getAction(policy1,final_test_sample);
action2 = getAction(policy2,final_test_sample);
action3 = getAction(policy3,final_test_sample);
When I run this code, the error is:
Incorrect number or types of inputs or outputs for function getAction.
action1 = getAction(policy1,final_test_sample);
I have cross-checked the final_test_sample; it has the same size as the input used during the training of the RL agent.
  2 件のコメント
Walter Roberson
Walter Roberson 2024 年 11 月 19 日 0:52
Note that the second input to getAction must be a cell array. We cannot tell from your code what data type final_test_sample is.
Hitesh
Hitesh 2024 年 11 月 19 日 5:52
Could you share the complete code or the file so that we reproduce the error and can further look for root cause of the error ?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeReinforcement Learning についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by