An integrated reweighting theory of perceptual learning