Implementation of Semantic Hashing. Modified from Ruslan Salakhutdinov and Geoff Hinton's code of training Deep AutoEncoder