https://medium.com/@monocosmo77/working-with-autoregressive-flow-part2-machine-learning-2023-b87626aa64a7