Learning Internal Representations (PhD Thesis)