## Appendix A Deep Learning Background  
### Neural Networks  
The following is drawn primarily from [40]. Neural networks (NNs) consist of multiple layers of interconnected units, or _neurons_, which transform input data through a series of learned weights and non-linear activation functions. Formally, for a neuron \(j\), the output is given by  
\[a_{j}=f\left(\sum_{i}w_{ji}x_{i}+b_{j}\right)\]  
where \(w_{ji}\) represents the _weight_ of the connection between neuron \(i\) and neuron \(j\), \(b_{j}\) is a _bias_ term, \(x_{i}\) are the input values, and \(f\) is the _activation function_, typically a non-linear function. The activation function introduces non-linearity into the model, allowing it to learn complex patterns and relationships in the data. Some of the most commonly used functions are the sigmoid, the tangent hyperbolic, and the rectified linear unit (ReLU) functions, where \(\text{ReLU}(x)=\max(0,x)\). NNs can be made up of three types of layers: the _input layer_, the _hidden layers_, and the _output layer_. The input layer receives the raw data that the network will process, while the hidden layers, which may consist of many neurons, perform intermediate calculations and transformations. The output layer then provides the final prediction or result of the network. These layers are densely interconnected, meaning each neuron in a given layer is connected to every neuron in the next layer. In the simplest form, information flows in one direction only, from the input layer through the hidden layers to the output layer. In this case, the NN is called a feedforward neural network (FFNN). Formally, we can express the FFNN as follows. Given an input \(x\in\mathbb{R}^{N}\) and a hidden linear model \(h\in\mathbb{R}^{D}\), the output \(o\in\mathbb{R}^{M}\) of the FFNN is  
\[ \begin{split} h&=g(Wx+b)\\ o&=f(Vh+c)\end{split}  \tag{1}\]  
where \(W\in\mathbb{R}^{N\times D}\) and \(V\in\mathbb{R}^{D\times M}\) are learnable weight matrices for input-to-hidden and hidden-to-output connections, respectively, \(b\in\mathbb{R}^{D}\) and \(c\in\mathbb{R}^{M}\) are learnable bias parameters, and \(g\) and \(f\) are non-linear activation functions, used to convert the output of the FFNN to a conditional probability distribution over the input. The training of a neural network involves learning the optimal values for the weight matrices \(W\) and \(V\), as well as the bias parameters \(b\) and \(c\), so that the network can accurately map inputs to the desired outputs. This learning process is guided by a _loss function_, which quantifies the difference between the predicted outputs and the actual target values. During training, the network iteratively adjusts its weights to minimize the loss function. This process is performed using an optimization algorithm such as _gradient descent_. Gradient descent updates the parameters by moving in the direction of the negative gradient of the loss function \(L\) with respect to the weights. Formally, the update rule for a parameter \(\theta\) at iteration \(t\) is given by  
\[\theta_{t+1}=\theta_{t}-\eta\
abla_{\theta}L(\theta_{t}), \tag{2}\]  
where \(\theta_{t}\) is the value of the parameter at iteration \(t\), \(\eta\) is the learning rate, which controls the step size of the updates, and \(\
abla_{\theta}L(\theta_{t})\) is the gradient of the loss function with respect to \(\theta\) at iteration \(t\). The gradients \(\
abla_{\theta}L\) are computed using _backpropagation_, a technique that applies the chain rule of calculus to efficiently calculate the gradients layer by layer. For a single weight \(w_{ij}\) connecting neurons \(i\) and \(j\), the chain rule can be expressed as  
\[\frac{\partial L}{\partial w_{ij}}=\frac{\partial L}{\partial a_{j}}\cdot \frac{\partial a_{j}}{\partial z_{j}}\cdot\frac{\partial z_{j}}{\partial w_{ ij}}, \tag{3}\]  
where \(a_{j}\) is the activation of neuron \(j\) and \(z_{j}\) is the weighted sum of inputs to neuron \(j\).