Learning by dilution in a neural network