Chapter 01
Functions
A function is a rule that assigns one output to each input. Neurons and layers in deep learning are functions.
Math diagram by chapter
Select a chapter to see its diagram below. View the flow of basic math at a glance.
One input x gives exactly one output y. The diagram below shows the flow x → f → y.
Example: x = 3 gives 7 for f(x) = 2x + 1
What is a function?
A function is a rule that assigns exactly one output to each input. Example: “multiply the input by 2 and add 1” → output y = 2x + 1. Here x is the input, y is the output, and the rule is the function.
We write y = f(x): f is the function, x is the input, f(x) is the output.
In deep learning, one neuron computes a dot product plus bias, then an activation function. So input to (linear) to (activation) to output is one function.
A layer is a function from an input vector to an output vector.
Dot product, matrix multiplication, linear layer, and softmax are all functions: numbers or vectors in, numbers or vectors out.
| Function | Example (input → output) |
|---|---|
| 3 → 4, 10 → 11 | |
| 3 → 6, 10 → 20 | |
| 3 → 9, → 4 |
In the visual below, f(x) = 2x + 1 gives 7 for x = 3 and 21 for x = 10. Fill in the blank in the problem.