Pruning random resistive memory for optimizing analogue AI