title: Episodic Semi-gradient Sarsa with Neural Network
body: <p>While trying to implement the <code>Episodic Semi-gradient Sarsa with</code> a Neural Network as the approximator I wondered how I choose the optimal action based on the currently learned weights of the network. If the action space is discrete I can just calculate the estimated value of the different actions in the current state and choose the one which gives the maximimum. But this seems to be not the best way of solving the problem. Furthermore, it does not work if the action space can be continous (like the acceleration of a self-driving car for example).</p>
  
  <p>So, basicly I am wondering how to solve the 10th line <code>Choose A' as a function of q(S', , w)</code> in this pseudo-code of Sutton:
  <a href="https://i.stack.imgur.com/nQotE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nQotE.png" alt="enter image description here"></a></p>
  
  <p>How are these problems typically solved? Can one recommend a good example of this algorithm using <code>Keras</code>?</p>
  
  <p>Edit: Do I need to modify the pseudo-code when using a network as the approximator? So, that I simply minimize the <code>MSE</code> of the prediction of the network and the reward <code>R</code> for example?</p>