Imported from https://github.com/ifding/simple-Infomax-pytorch