This repository contains the PyTorch implementation for training a Continuous Normalizing Flow (CNF) to solve density estimation on the "Two Moons" dataset. It utilizes the TorchDyn library to handle ODE integration and the Adjoint Sensitivity Method.
This code accompanies my article series "Beyond Layers", where I explain the intuition and mathematics behind Neural ODEs.
- Part 1: The Intuition Behind Neural ODEs - Moving from discrete layers to continuous dynamics.
- Part 2: Implementing Continuous Normalizing Flows - A practical guide to training CNFs for generative modeling.
Transforming a standard Gaussian distribution (
(Above: A GIF of the learned flow carrying noise particles to the data manifold)
The model successfully learned a continuous probability density function that matches the geometry of the target dataset.
The model minimizes the Negative Log-Likelihood (NLL) effectively over 250 epochs.
- Clone the repository
git clone https://github.com/vaishnavibiradar/beyond-layers-cnf.git cd beyond-layers-cnf



