Working Of A Single Neuron.

Table Of Contents:

  1. The Linear Unit.
  2. Example: The Linear Unit As A Model.
  3. Multiple Inputs.

(1) The Linear Unit.

  • So let’s begin with the fundamental component of a neural network: the individual neuron. As a diagram, a neuron (or unit) with one input looks like below:
  • The input is x.
  • Its connection to the neuron has a weight which is w.
  • Whenever a value flows through a connection, you multiply the value by the connection’s weight.
  • For the input, what reaches the neuron is w * x.
  • A neural network “learns” by modifying its weights.
  • The b is a special kind of weight we call the bias.
  • The bias doesn’t have any input data associated with it; instead, we put a 1 in the diagram so that the value that reaches the neuron is just b (since 1 * b = b).
  • The bias enables the neuron to modify the output independently of its inputs.
  • The y is the value the neuron ultimately outputs.
  • To get the output, the neuron sums up all the values it receives through its connections. This neuron’s activation is or as a formula y=wx+b
  • Is the formula y=wx+b look familiar?
    It’s an equation of a line! It’s the slope-intercept equation, where w is the slope and b is the y-intercept.

(2) The Linear Unit As A Model

  • Though individual neurons will usually only function as part of a larger network, it’s often useful to start with a single-neuron model as a baseline.
  • Single-neuron models are linear models.
  • Let’s think about how this might work on a dataset like 80 Cereals. Training a model with 'sugars' (grams of sugars per serving) as input and 'calories' (calories per serving) as output, we might find the bias is b=90 and the weight is w=2.5. We could estimate the calorie content of a cereal with 5 grams of sugar per serving like this:
  • And, checking against our formula, we have calories=2.5×5+90=102.5, just like we expected.

(3) Multiple Inputs

  • The 80 Cereals dataset has many more features than just 'sugars'. What if we wanted to expand our model to include things like fibre or protein content? That’s easy enough.
  • We can just add more input connections to the neuron, one for each additional feature. To find the output, we would multiply each input by its connection weight and then add them all together.
  • The formula for this neuron would be y=w0x0+w1x1+w2x2+b.
  • A linear unit with two inputs will fit a plane, and a unit with more inputs than that will fit a hyperplane.

Leave a Reply

Your email address will not be published. Required fields are marked *