mbaddar1 / genmodel Goto Github PK
View Code? Open in Web Editor NEWGenerative Model Experiments
License: Apache License 2.0
Generative Model Experiments
License: Apache License 2.0
https://github.com/mbaddar1/denoising-diffusion-pytorch
Understand
https://github.com/mbaddar1/score_sde_pytorch/tree/cb1f359f4aadf0ff9a5e122fe8fffc9451fd6e44
Understand how Repo works
Plan a set of small experiments, and viz to test the points you have understood in #7
Document these experiments plan into #9
This is a preliminary experiment of the experiment set document in sec 8.7.1 here
https://github.com/mbaddar1/phd_latex/blob/c37daefa57518c5d4fa762a7cb254f1cbaa5c617/out/main.pdf
Experiment objectives :
Get hands on with DDPM PyTorch Repo https://github.com/mbaddar1/denoising-diffusion-pytorch
Understand the UNet architecture
Understand the DDPM L2 loss function
Plot the evolution of evaluation metric and loss function
Conduct an experiment as follows
Dataset :
for test :
1 ) mvn 2d as in my test code here
https://github.com/mbaddar1/genmodel/blob/master/sandbox/diffmodel/simple_diffusion_model.py#L33
and also similar to this mvn experiment here
dff6026
In the old experiment the code was using KL divergence and some different head and time variant tail as model, instead of UNet
In this experiment : we will use UNet and DDPM L2. Both will use Gradient Descent
https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_swiss_roll.html
2 ) Circles
https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_circles.html
similar to the previous experiment
Model
Use UNet model as in this code part
https://github.com/mbaddar1/denoising-diffusion-pytorch/blob/main/denoising_diffusion_pytorch/denoising_diffusion_pytorch.py#L272
Loss function
Use the L2 Loss as in
https://arxiv.org/pdf/2006.11239.pdf eq 14 p5
Optimization Method
Gradient Descent as in
https://arxiv.org/pdf/2006.11239.pdf Algorithm 1 P4
Evaluation Metric
FID as in Fig 3 and 4 in https://arxiv.org/pdf/2006.11239.pdf
https://arxiv.org/pdf/2011.13456.pdf
Main points to grasp
Objective to have some function q-measure(sample) that gives a measure on the generated sample, to use along with L2 loss while training the diffusion model.
Dataset :
Focus mainly on the sinkhorn algorithm
https://github.com/fwilliams/scalable-pytorch-sinkhorn?tab=readme-ov-file
misc links
https://gist.github.com/atabakd/ed0f7581f8510c8587bc2f41a094b518
sinkhorn
https://amsword.medium.com/a-simple-introduction-on-sinkhorn-distances-d01a4ef4f085
https://papers.nips.cc/paper_files/paper/2013/hash/af21d0c97db2e27e13572cbf59eb343d-Abstract.html
apply the DDPM code to sklearn swissroll, conc circles, and half moons dataset. find an objective eval measure
\subsection{Work-Schedule}\label{subsec:time-table}
\begin{enumerate}
\item Read about score/gradient matching based generative models~\cite{Generati61:online} 20-Nov-2023 \textcolor{cyan}{DONE}
\item Read this comprehensive paper :\cite{song2021scorebased} 20 to 25 Nov 2023 \textcolor{green}{In progress}
\begin{enumerate}
\item Focus on section 2.1 (score-matching) \textcolor{cyan}{done}
\item Focus on section 2.2 (DDPM) \textcolor{green}{in prgoress}
\item Skim through the rest
\end{enumerate}
\item A quick overview for this diffusion model tutorial~\cite{weng2021diffusion} 22-Nov-2023 -> Focus on
Loss function understanding and derivation , also on different variants of it
\item Experiment these two simple implementation of DDPM~\cite{aju22DDP15:online,Generati57:online}.
Have a look at this bigger one~\cite{lucidrai97:online}
\item Hands on coding for the basic score matching~\cite{DBLP:journals/corr/abs-1907-05600}
From scratch implementation can be good for learning~\cite{Benefits95:online}. \newline
Try this tutorial \cite{Tutorial71:online} which I have found in this GitHub page~\cite{yangsong73:online}
and blog post \cite{Generati61:online}
=============================
\item A quick overview for Deep Learning Book~\cite{jentzen2023mathematical}
\textbf{Focus on Chapter 5 -> Gradient-FLow} 25-Nov-2023
\item A quick overview Riemannian Optimization~\cite{smith2014optimization}
\item Check this paper for TT-DNN \cite{qi2022exploiting} (Good One)
\item Check this TT-DNN paper~\cite{qi2019riemannian} (Rejected one)
\item TT-GP \cite{izmailov2018scalable}
\item A quick overview for this Riemannian Optimization Autograd paper~\cite{novikov2021automatic} 26-Nov-2023
\item Riemannian Optimization with T3F lib \cite{novikov2020tensor}
\item A quick overview for this Diffusion Model survey paper~\cite{yang2023diffusion} 27-Nov-2023
\item Try to make connections between topics from Riemannian Opt or DL Book to Diffusion Models 27 to 28 Nov 2023
\item Experimentation the score sde method(\href{https://github.com/yang-song/score_sde}{code})
and DDPM (\href{https://github.com/lucidrains/denoising-diffusion-pytorch}{code}).
29 Nov 2023
\end{enumerate}
%%%
\subsubsection{Understanding Connection Between Diffusion Models, Langevin Dynamic and Differential Equations}
\label{subsubsec:conn-ddpm-lavdyn-diffeq}
\begin{itemize}
\item write the sampling eqns of both langevin dyn , ddpm \cite{weng2021diffusion}
\item compare {$\epsilon_{\theta}$} and $\nabla_{x} \log p(x)$ .
\item Highlight that the derivation of correspondence between DDPM and SMLD losses is heuristic based
Eq (3) in \cite{song2021scorebased} and Eq(12) in \cite{ho2020_ddpm}
\end{itemize}
U-Net in DDPM
https://arxiv.org/pdf/1505.04597v1.pdf
NCSN
sec 4
https://arxiv.org/pdf/1907.05600.pdf
Code
/home/mbaddar/Documents/mbaddar/phd/genmodel/score_sde_pytorch/models
This experiment is similar to #14 except that we will use Tensor Train mode, similar to the one in
https://arxiv.org/abs/2108.00089 p2 for modeling
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.