The physics of learning machines