How to deploy Trained Reinforcement Learning Policy with a NN having two input layer?
1 次查看(过去 30 天)
显示 更早的评论
I am having a trained DQN agent, that I want to use in a C++ project. By definition this agent has a deep neural network with two input layers (observation first, action second).
In this Article about deploying RL policies it is stated that "Generating code for deep neural network policies supports networks with only a single input layer".
This is why I cannot us the generatePolicyFunction on my trained DQN agent.
However is there another way to deploy an DQN agent?
_____________________________________________________________________________________
PS: Even your own example with a predefined DQN agent (two input layers) described here is not working. The following commands
load('MATLABCartpoleDQN.mat','agent')
generatePolicyFunction(agent,'FunctionName',"computeAction")
still give me the output: "Code Generation for rlLayerRepresentation objects supports only networks with a single input layer and a single output layer"
Thanks for your answers.
0 个评论
采纳的回答
Anh Tran
2020-3-21
编辑:Anh Tran
2020-3-21
As of R2020a, you can create a DQN agent with Q(s) value function. Q(s) takes observation as input and output Q(s,a) for each possible discrete action. If you have single observation channel, you can generate the policy function and deploy since the Q(s) network now has a single input, observation.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!