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.

채택된 답변

Anh Tran
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개)

카테고리

Help CenterFile Exchange에서 Reinforcement Learning에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by