Learning of likelihoods for Bayesian computations