Learning Features for Unsupervised Learning and Reinforcement Learning