Deep Learning of Representations for Unsupervised and Transfer Learning