Bridging Associative Memory and Probabilistic Modeling