Classification and Generation of real-world data with an Associative Memory Model