Learning Low-Level Priors From Images for Inference and Synthesis