got the reweighting in the autoencoder class as well