
The simplest form of the ANN is the perceptron. One single unit that performs an operation on inputs and returns a single output. Here the $w_x$'s are called the weights or sometimes the parameters.

$$
\large
f(w_1 x_1 + w_2 x_2 + ... + w_N x_N + b) = f\left(b + \sum_{i=1}^{N} w_i x_i \right) = y
$$
$f(x)$ is called the activation function and $b$ is the bias. In principal $f$ could be anything but is typically some non-linear function.
We can stack these perceptrons together to introduce more parameters and more non-linear behavior
$$ \large f\left(b + \sum_{i=1}^{N} w_{i} h_i(x) \right) = y $$where $h_i(x)$ can be another set of perceptrons like in the previous slides.
Notice that our definition of a perceptron is the same as matrix multiplication. From before we had:
$$
\large
f\left(b_i + \sum_{i=1}^{N} w_{ij} x_i \right) = y_i
$$
Now as matrices:
$$
\large
W = \begin{bmatrix}
w_{11} & w_{12} & \dots \\
\vdots & \ddots & \\
w_{i1} & & w_{ij} \\
\end{bmatrix}
;\quad
X = \begin{bmatrix}
x_1 \\
x_2 \\
\vdots \\
x_i
\end{bmatrix}
\quad \quad
f\left(B + WX\right) = Y
$$
The $f(x)$ we used earlier introduces non-linearity into the perceptron. Without non-linearities a multilayer perceptron would reduce to a single layer perceptron through a simple redefinition of parameters (the $w$s).

This seems like a simple optimization problem. Find the $w_{ij}$ that minimize (insert thing to minimize here).
But what do we minimize? How do we find where that thing is a minimum?

To find the bottom we can simply take a series of small steps "downhill".
The thing to minimize we call the loss or loss function. It is simply a measure of distance between what the output of our network is and what we think it should be for a given input.
The simplest loss function you could have is the Mean Absolute Error (MAE)
$$ \Large MAE = |y-\hat{y}| $$Here $y$ is the "target" or what we want the network to output, and $\hat{y}$ is the actual output of the network.
![]() |
|
This is done by calculating the gradient at your current point then taking a step in the direction of the steepest slope. Lets consider a two layer perceptron with a single input and output.
$$
\large
h(x) = f(b_1 + w_1 x)
$$
is the value of the hidden unit, and
$$ \large \hat{y} = f( b_2 + w_2 h(x)) $$is the value of the output.
The update rule for our weights is,
$$
\large
w_{t+1} = w_t - \epsilon \frac{\partial L}{\partial w_t}; \space \space b_{t+1} = b_t - \epsilon \frac{ \partial L }{ \partial b_t}
$$
Where $L$ is our loss function. So we need to find the gradients of the loss with respect to the parameters of the network. For a one layer network this is easy, but for deeper networks we can use the chain rule.
where we have set $\large z_2 = b_2 + w_2 h(x)$
Now we simply have to take a step in the direction of the gradient...
$$
\Large
w_{t+1} = w_t - step
$$
... then do it again.
Note: The way computers calculate derivates is through a process called Auto-differentiation. It uses the chain rule to split the derivative up into smaller parts until it can evaluate a math primative. This is very similar to what we want to do with backpropagation.
Network takes the role of an Agent which can take actions and Observe their effects on an Environment. The agent learns to take actions that maximise a desired outcome by trying to gain the most Reward.
Any combination of preceptrons arranged in layers.

Common uses are classification and regression.

Maybe we want to find the decay parameter in the function $y=e^{-\frac{x}{\sigma}}$. In this case the input could be the $y$ value in each $x$ bin with the goal of predicting. Then the output would be our prediction of the parameter $\hat \sigma$.

CNNs have their weights arranged into "filters". This makes them preserve spatial nature of the inputs. The easiest way to see how this works is to look at an example:


The output of the node (the hidden state) is concatenated with the next input. This recurrence allows the network to learn patterns in sequences of data.
Commonly used in NLP to generate sentences or translate from one language to another.
A common structure for a recurrent network is the Encoder-Decoder type model. This is where the RNN is split into two parts. The full input is passed to the decoder, then a single hidden state is passed to the decoder which generates the outputs.
Our predictive NDVI model is an Encoder-Decoder model that uses convultional LSTMs as the network. The input is a time stack of imagery separated by 7 days.

Unsupervised learning - The inputs are used as the labels.
Can be used as a learned compression for a specific type of data. Can be used as an anomoly detector by selecting inputs that have a large reconstruction error.
There are a ton of variations on autoencoders.