Flow-based generative models as iterative algorithms in probability space