Answers.Body: <p>You need to perform Hyperparameter Tuning to identify -</p>
  
  <ol>
  <li>Number of hidden layers.</li>
  <li>Number of neurons in each of the hidden layers.</li>
  <li>Dropout</li>
  <li>The activation function you use in each of your hidden layers.</li>
  </ol>
  
  <p>There parameters are only related to how you build your model. There are others that relate to training like batch size, number of epochs and so on. Your model's performance ultimately depends on how well you tune your hyperparameters.</p>
  
  <p>Also note that hyperparameter tuning is a trial and error task because it depends on several factors that may not be obvious to us. With experience, experts do build certain thumb rules about what may be the right choice, but there is no way to generalize it. "Some say the number of hidden layers is roughly the number of separation times" - is just another thumb rule. You simply need to find out what best suits your scenario.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-10T06:42:45.267Z
Answers.LastActivityDate: 2019-09-10T06:42:45.267Z
Answers.UserDisplayName: Dishant Sheth
Body: <p>I'm trying to separate classes in 3D space, the data are as in the sketch below:</p>
  
  <p><a href="https://i.sstatic.net/wMQ0U.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/wMQ0U.png" alt="enter image description here"></a></p>
  
  <p>There are 3 classes: <strong>0,1,2</strong>; and with the look into the sketch, it seems that I need <strong>3 planes to separate</strong> the classes, thus how <strong>many hidden layers should be in the DNN</strong>? Any roughly how many neurons in each layer?</p>
  
  <p>Some say the number of hidden layers is roughly the number of separation times, so I put 3 hidden layers and it worked! But any reasons behind that simple measure?</p>
  
Tags: <neural-networks><machine-learning><deep-neural-networks><hidden-layers><regression>
Title: How many hidden layers are needed for this training data set
UserDisplayName: Dan D.
ThreadText: # How many hidden layers are needed for this training data set
  
  (Asked by: username_0 on 2019-09-10)
  
  I'm trying to separate classes in 3D space, the data are as in the sketch below:
  
  [![enter image description here](https://i.sstatic.net/wMQ0U.png)](https://i.sstatic.net/wMQ0U.png)
  
  There are 3 classes: **0,1,2**; and with the look into the sketch, it seems that I need **3 planes to separate** the classes, thus how **many hidden layers should be in the DNN**? Any roughly how many neurons in each layer?
  
  Some say the number of hidden layers is roughly the number of separation times, so I put 3 hidden layers and it worked! But any reasons behind that simple measure?
  
  **Tags:** neural-networks, machine-learning, deep-neural-networks, hidden-layers, regression
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-09-10. Score: 2 | Accepted answer
  
  You need to perform Hyperparameter Tuning to identify -
  
  1. Number of hidden layers.
  2. Number of neurons in each of the hidden layers.
  3. Dropout
  4. The activation function you use in each of your hidden layers.
  
  There parameters are only related to how you build your model. There are others that relate to training like batch size, number of epochs and so on. Your model's performance ultimately depends on how well you tune your hyperparameters.
  
  Also note that hyperparameter tuning is a trial and error task because it depends on several factors that may not be obvious to us. With experience, experts do build certain thumb rules about what may be the right choice, but there is no way to generalize it. "Some say the number of hidden layers is roughly the number of separation times" - is just another thumb rule. You simply need to find out what best suits your scenario.
  
  
  ---
  
  