Learning Generative Models with the Up Propagation Algorithm