Made learn_weights() slightly less verbose.