Updated python file for generating hidden rep for training