Neural Networks as Tools for Posterior Estimation and Inference