Answers.Body: <p>You would still be picking a single action. Your action space is now <span class="math-container">$\mathcal{A} = \mathcal{O} \times \mathcal{I}$</span> where I've chosen <span class="math-container">$\mathcal{O}$</span> to be the set of possible orders from your problem and <span class="math-container">$\mathcal{I}$</span> to be the set of possible items.</p>
  <p>Provided both of these sets are finite, then you should still be able to approach this problem with DQN. Theoretically, this should be easy to see, as any element from <span class="math-container">$\mathcal{A}$</span> is still a single element it just happens that this element is now a tuple.</p>
  <p>From a programming point of view, let's consider the simple example of cartpole, where the possible actions are left and right. Your <span class="math-container">$Q$</span>-function obviously won't know the meanings of 'left' and 'right', you just assign it to an element of a vector, i.e. your <span class="math-container">$Q$</span>-function would output a vector in <span class="math-container">$\mathbb{R}^2$</span> with e.g. the first element corresponding to the score for 'left' and the second element corresponding to the score for 'right'. This is still the case in your problem formulation, you will just have a <span class="math-container">$Q$</span>-function that outputs a vector in <span class="math-container">$\mathbb{R}^d$</span> where <span class="math-container">$d = |\mathcal{A}|$</span> - you would just have to make sure you know which element corresponds to which action.</p>
  <p>Also, there is the possibility that this approach could leave you with a large dimensional vector output, which I imagine would probably mean you'd need more simulations to properly explore the action space.</p>
  <p>Hope this helps.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-26T19:04:33.077Z
Answers.LastActivityDate: 2020-07-26T22:08:20.720Z
Answers.LastEditDate: 2020-07-26T22:08:20.720Z
Answers.UserDisplayName: David
Body: <p>I'm new to reinforcement learning. I have a problem where an action is composed of an order (rod with a required length) and an item from a warehouse (an existing rod with a certain length, which will be cut to the desired length and the remainder put back to the warehouse).</p>
  <p>I imagine my state as two lists of a defined size: orders and warehouse, and my action as an index from the first list and an index from the second list. However, I have only worked with environments where it was only possible to pick single action and I'm not sure how to deal with two indexes. I'm not sure how DQN architecture should look like to give me such action.</p>
  <p>Can anyone validate my general idea and help me find a solution? Or maybe just point me to some papers where similar problems are described?</p>
  
Tags: <reinforcement-learning><q-learning><dqn><markov-decision-process><environment>
Title: Reinforcement learning with action consisting of two discrete values
UserDisplayName: GUZ
ThreadText: # Reinforcement learning with action consisting of two discrete values
  
  (Asked by: username_0 on 2020-07-26)
  
  I'm new to reinforcement learning. I have a problem where an action is composed of an order (rod with a required length) and an item from a warehouse (an existing rod with a certain length, which will be cut to the desired length and the remainder put back to the warehouse).
  
  I imagine my state as two lists of a defined size: orders and warehouse, and my action as an index from the first list and an index from the second list. However, I have only worked with environments where it was only possible to pick single action and I'm not sure how to deal with two indexes. I'm not sure how DQN architecture should look like to give me such action.
  
  Can anyone validate my general idea and help me find a solution? Or maybe just point me to some papers where similar problems are described?
  
  **Tags:** reinforcement-learning, q-learning, dqn, markov-decision-process, environment
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-07-26. Score: 4 | Accepted answer
  
  You would still be picking a single action. Your action space is now $\mathcal{A} = \mathcal{O} \times \mathcal{I}$ where I've chosen $\mathcal{O}$ to be the set of possible orders from your problem and $\mathcal{I}$ to be the set of possible items.
  
  Provided both of these sets are finite, then you should still be able to approach this problem with DQN. Theoretically, this should be easy to see, as any element from $\mathcal{A}$ is still a single element it just happens that this element is now a tuple.
  
  From a programming point of view, let's consider the simple example of cartpole, where the possible actions are left and right. Your $Q$-function obviously won't know the meanings of 'left' and 'right', you just assign it to an element of a vector, i.e. your $Q$-function would output a vector in $\mathbb{R}^2$ with e.g. the first element corresponding to the score for 'left' and the second element corresponding to the score for 'right'. This is still the case in your problem formulation, you will just have a $Q$-function that outputs a vector in $\mathbb{R}^d$ where $d = |\mathcal{A}|$ - you would just have to make sure you know which element corresponds to which action.
  
  Also, there is the possibility that this approach could leave you with a large dimensional vector output, which I imagine would probably mean you'd need more simulations to properly explore the action space.
  
  Hope this helps.
  
  
  ---
  
  