We study the problem of implementing a fully-connected layer of a neural network using wireless over-the-air computing. We assume a multi hop system with a multi-antenna transmitter and receiver, along with a number of multi-hop amplify-and-forward relay devices in between. We formulate an optimization problem that optimizes the transmitter precoder, receiver combiner and amplify-and-forward gains, subject to relay device power constraint and transmitter power constraint. We propose an alternating optimization framework that optimizes the imitation accuracy. Simulation study results reveal that multi-hop relaying achieves an almost perfect classification accuracy when used in a neural network.