Learning And Inferring Representations Of Data In Neural Networks