# Neurons are like functions

A neuron simply takes in data, performs a function on it, and outputs a result. It’s just like functions in math or programming!

## ## The power of a single neuron

Let’s use one neuron to perform a function! A great tool for playing with neural networks is TensorFlow Playground. You can find the link here. If you click on it, you’ll see the example I’m about to cover.

Our goal is to draw a clear line that separates the orange and blue scatterplot.

The function of the neuron is to take two x-inputs and combine them to calculate a diagonal line that will divide the scatterplot.

Click the play button to see the neuron in action! After several attempts, it will “learn” the values of

`x1`

and`x2`

that are needed to draw the dividing line.

## ## Limitations

As we saw, a single neuron can succeed in this simple classification task. However, what if we had a more complex shape to classify?

Several datasets are available in TensorFlow Playground. If you try changing the shape to something else, you’ll see that the neuron will fail. These complex shapes require more lines to be drawn.

## ## Add more neurons!

To properly classify this scatterplot, we need to:

- Add two more neurons (3 total)
- Change the ‘Activation’ field from
`linear`

to`tanh`

(this topic is for another day)

After some iterations, the three neurons will succeed! You can find the TensorFlow Playground link for this demo here.

## ## Conclusion

Neurons perform mathematical functions and take parameters (x1, x2, x…, x99) to output a result. Having more neurons makes it possible to perform more complex tasks.