Answers.Body: <p>The purpose of the input layer is just to conceptually represent the input and, in case it is necessary, define the dimensions of the input that the neural network expects. In fact, some neural networks, such as multi-layer perceptrons, expect a fixed-size input, but not all of them: fully convolutional networks can deal with inputs of different dimensions.</p>
  <p>The input layer doesn't contain neurons (although in the diagrams that you will come across they are usually represented as circles, like the neurons, and that's probably why you are confused!), so it also does not contain biases, linear transformations, and non-linearities. In fact, in the context of neural networks, you could define a neuron as some unit/entity that performs a linear or non-linear transformation (to which you can add a bias). Note that the hidden and output layers can contain biases because they contain neurons that perform a linear or non-linear transformation.</p>
  <p>However, although I have never seen it (or I don't recall having seen it), I would not exclude the existence of an input layer that transforms or augments the inputs before passing them to the next layer. For example, one could implement a neural network that first scales the input to a certain range, and the input layer could do this, although, in practice, this is typically done by some object/class that does not belong to the neural network (e.g. <a href="https://www.tensorflow.org/api_docs/python/tf/data/Dataset" rel="nofollow noreferrer"><code>tf.data.Dataset</code></a>).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-08T12:37:32.347Z
Answers.LastActivityDate: 2020-07-08T22:48:21.777Z
Answers.LastEditDate: 2020-07-08T22:48:21.777Z
Answers.UserDisplayName: nbro
Body: <p>I have seen two different representations of neural networks when it comes to bias. Consider a &quot;simple&quot; neural network, with just an input layer, a hidden layer and an output layer. To compute the value of a neuron in the hidden layer, the weights and neurons from the input layer are multiplied, shifted by a bias and then activated by the activation function. To compute the values in the output layer, you may choose not to have a bias and have an identity activation function on this layer, so that this last calculation is just &quot;scaling&quot;.</p>
  <p>Is it standard to have a &quot;scaling&quot; layer? You could say that there is a bias associated with each neuron, except those in the input layer correct (and those in the output layer when it is a scaling layer)? Although I suppose you could immediately shift any value you're given. Does the input layer have a bias?</p>
  <p>I have seen bias represented as an extra unchanging neuron in each layer (except the last) having value 1, so that the weights associated with the connections from this neuron correspond to the biases of the neurons in the next layer. Is this the standard way of viewing bias? Or is there some other way to interpret what bias is that is more closely described by &quot;a number that is added to the weighted sum before activation&quot;?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-08T04:43:52.683Z
Comments.Text: I can't give an adequate reason as to why this is - but in all cases I've seen the input layer never has any bias associated to it. You just multiply it by the weights of between input and 1st hidden/output layer.
Comments.UserDisplayName: Recessive
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-04-05T04:59:26.703Z
Comments.Text: @mark yeah, that's just "scaling" without bias, bias is for shifting the separation line
Comments.UserDisplayName: Dan D.
Tags: <neural-networks>
Title: Does the input layer of a neural network have bias and are there bias neurons?
UserDisplayName: Mark
ThreadText: # Does the input layer of a neural network have bias and are there bias neurons?
  
  (Asked by: username_0 on 2020-07-08)
  
  I have seen two different representations of neural networks when it comes to bias. Consider a "simple" neural network, with just an input layer, a hidden layer and an output layer. To compute the value of a neuron in the hidden layer, the weights and neurons from the input layer are multiplied, shifted by a bias and then activated by the activation function. To compute the values in the output layer, you may choose not to have a bias and have an identity activation function on this layer, so that this last calculation is just "scaling".
  
  Is it standard to have a "scaling" layer? You could say that there is a bias associated with each neuron, except those in the input layer correct (and those in the output layer when it is a scaling layer)? Although I suppose you could immediately shift any value you're given. Does the input layer have a bias?
  
  I have seen bias represented as an extra unchanging neuron in each layer (except the last) having value 1, so that the weights associated with the connections from this neuron correspond to the biases of the neurons in the next layer. Is this the standard way of viewing bias? Or is there some other way to interpret what bias is that is more closely described by "a number that is added to the weighted sum before activation"?
  
  **Tags:** neural-networks
  
  > **Comments:**
  > **username_1**: I can't give an adequate reason as to why this is - but in all cases I've seen the input layer never has any bias associated to it. You just multiply it by the weights of between input and 1st hidden/output layer.  
  > **username_2**: @mark yeah, that's just "scaling" without bias, bias is for shifting the separation line  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2020-07-08. Score: 4 | Accepted answer
  
  The purpose of the input layer is just to conceptually represent the input and, in case it is necessary, define the dimensions of the input that the neural network expects. In fact, some neural networks, such as multi-layer perceptrons, expect a fixed-size input, but not all of them: fully convolutional networks can deal with inputs of different dimensions.
  
  The input layer doesn't contain neurons (although in the diagrams that you will come across they are usually represented as circles, like the neurons, and that's probably why you are confused!), so it also does not contain biases, linear transformations, and non-linearities. In fact, in the context of neural networks, you could define a neuron as some unit/entity that performs a linear or non-linear transformation (to which you can add a bias). Note that the hidden and output layers can contain biases because they contain neurons that perform a linear or non-linear transformation.
  
  However, although I have never seen it (or I don't recall having seen it), I would not exclude the existence of an input layer that transforms or augments the inputs before passing them to the next layer. For example, one could implement a neural network that first scales the input to a certain range, and the input layer could do this, although, in practice, this is typically done by some object/class that does not belong to the neural network (e.g. [`tf.data.Dataset`](https://www.tensorflow.org/api_docs/python/tf/data/Dataset)).
  
  
  ---
  
  