Artificial neural network based on SQUIDs: demonstration of network training and operation