A hierarchical Bayesian approach to regularization with application to the inference of relaxation spectra