Answers.Body: <p>the use of Tanh is purely because it fits the described problem (Especially for values that are min-max normalized). I have worked on couple of professional RL projects ( specifically with actions in the continuous space) and I did not use tanh at all. Hope that helped :)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-26T08:37:41.403Z
Answers.Text: What activation function did you use then? Are there rules of thumb which activation function to use for which use case?
  
  For example, in classification there's the rule to use sigmoid for binary classification and softmax for multi-class classification.
Answers.UserDisplayName: stefanbschneider
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-26T10:03:25.460Z
Answers.Text: There is no rule of thumb, it totally depends on your own problem. But as a good practice, you might want to use a function that bounds the values in a realistic range according to the actions that you want to predict.
Answers.UserDisplayName: SellaDev
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-26T15:44:30.353Z
Answers.Text: Ok, that's not the answer I was hoping for :D But thank you anyways!
Answers.UserDisplayName: stefanbschneider
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-27T05:02:12.653Z
Answers.Text: Sorry for the bad news, but if you want to excel in machine learning in general, there is no actual rule of thumb for everything (including sigmoid for binary classification, it is just widely used and not a rule of thumb ), you have to try to think freely and solve each problem on it's own. you are welcome.
Answers.UserDisplayName: SellaDev
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-25T16:56:35.600Z
Answers.LastActivityDate: 2019-05-16T03:41:37.453Z
Answers.LastEditDate: 2019-05-16T03:41:37.453Z
Answers.UserDisplayName: SellaDev
Body: <p>I'm interested in building a (deep) RL agent for solving a continuous problem (which splits something into portions).</p>
  
  <p>In all examples I've seen so far, e.g., <a href="https://github.com/openai/gym/wiki/Leaderboard#lunarlandercontinuous-v2" rel="nofollow noreferrer">solving the continuous lunar lander</a>, always a <span class="math-container">$\tanh$</span> output layer activation was used, which produces values between <span class="math-container">$-1$</span> and <span class="math-container">$+1$</span>.</p>
  
  <p>Is this just because it fits the use case or is this a general rule for RL agents with continuous action spaces?</p>
  
  <p>What if I just want values between <span class="math-container">$0$</span> and <span class="math-container">$1$</span>? Could I simply use a <span class="math-container">$\operatorname{softmax}$</span> activation for my output layer?</p>
  
Tags: <neural-networks><reinforcement-learning><deep-rl><activation-functions>
Title: Regarding the output layer's activation function for continuous action space problems
UserDisplayName: stefanbschneider
ThreadText: # Regarding the output layer's activation function for continuous action space problems
  
  (Asked by: username_0 on 2019-03-25)
  
  I'm interested in building a (deep) RL agent for solving a continuous problem (which splits something into portions).
  
  In all examples I've seen so far, e.g., [solving the continuous lunar lander](https://github.com/openai/gym/wiki/Leaderboard#lunarlandercontinuous-v2), always a $\tanh$ output layer activation was used, which produces values between $-1$ and $+1$.
  
  Is this just because it fits the use case or is this a general rule for RL agents with continuous action spaces?
  
  What if I just want values between $0$ and $1$? Could I simply use a $\operatorname{softmax}$ activation for my output layer?
  
  **Tags:** neural-networks, reinforcement-learning, deep-rl, activation-functions
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-03-25. Score: 1
  
  the use of Tanh is purely because it fits the described problem (Especially for values that are min-max normalized). I have worked on couple of professional RL projects ( specifically with actions in the continuous space) and I did not use tanh at all. Hope that helped :)
  
  > **Comments:**
  > **username_0**: What activation function did you use then? Are there rules of thumb which activation function to use for which use case?  For example, in classification there's the rule to use sigmoid for binary classification and softmax for multi-class classification.  
  > **username_1**: There is no rule of thumb, it totally depends on your own problem. But as a good practice, you might want to use a function that bounds the values in a realistic range according to the actions that you want to predict.  
  > **username_0**: Ok, that's not the answer I was hoping for :D But thank you anyways!  
  > **username_1**: Sorry for the bad news, but if you want to excel in machine learning in general, there is no actual rule of thumb for everything (including sigmoid for binary classification, it is just widely used and not a rule of thumb ), you have to try to think freely and solve each problem on it's own. you are welcome.  
  
  ---
  
  