call it a ‘fan-out’ operation rather than a copying operation, as it distributes information about the input state into several output qubits. Note that a quantum network would be *trained* to choose the unitary in question.

![\[fig:cl\_autoencoder\]A classical autoencoder taking two inputs $in_{1}=a^{(0)}_{1}$ and $in_{2}=a^{(0)}_{2}$ and compressing them to one hidden layer output $a^{(l)}_{1}$. The final output layer is used in training and is trained to reconstruct the inputs. The notation here is in accordance with [@Nielsen15]. The blue box represents the data compression device after the training procedure.](cl_autoencoder.png){height="3cm"}

### Efficient training with gradient descent {#efficient-training-with-gradient-descent .unnumbered}

A classical neural network is trained to perform particular tasks. This is done by randomly initialising the weights and then propagating inputs through the network many times, altering the weights after each propagation in such a way as to make the network output closer to the desired output. A cost function, $C$, relating the network output to the desired output is defined by $$\label{eq:cost}
C = \frac{1}{2}\Big|\vec{y}^{\:(L)}-\vec{a}^{\:(L)}\Big|^2,$$ where $\vec{y}^{\:(L)}$ is a vector of the desired outputs from each of the final layer $l=L$ neurons and $\vec{a}^{\:(L)}$ is the vector of actual outputs, which depends on the network weights, and $\Big|(.)\Big|$ is the $l^2$-norm. 