← 开源
shayneobrien

generative-models

Annotated, understandable, and visually interpretable PyTorch implementations of: VAE, BIRVAE, NSGAN, MMGAN, WGAN, WGANGP, LSGAN, DRAGAN, BEGAN, RaGAN, InfoGAN, fGAN, FisherGAN

TutorialsML/AI fundamentalsJupyter Notebook
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
504
Star
72
Fork
+1
本周
2
贡献者
创建于 2018-04-17 · 更新于 2026-10-11 · 今日第 18244 名
主要开发者
shayneobrienmattgroh

shayneobrien/generative-models 排名第 18,244,有 504 个星标。

同类别比较

shayneobrien/generative-models 排名第 18,244,此处有 8 个同类条目;wellflat/imageprocessing-labs 排名第 18,247。

同类别比较
名称排名指标
gau-nernst/learn-cuda18,207
语言:
Cuda
星标数:
505
分叉数:
67
简介:
Learn CUDA with PyTorch
SmartFlowAI/Llama3-Tutorial18,226
语言:
Python
星标数:
504
分叉数:
53
简介:
Llama3-Tutorial(XTuner、LMDeploy、OpenCompass)
hemingkx/ChineseNMT18,236
语言:
Python
星标数:
504
分叉数:
90
简介:
ChineseNMT: Translate English to Chinese with PyTorch Implementation of Transformer
jiahe7ay/MINI_LLM18,239
语言:
Python
星标数:
504
分叉数:
73
简介:
This is a repository used by individuals to experiment and reproduce the pre-training process of LLM.
wellflat/imageprocessing-labs18,247
语言:
JavaScript
星标数:
504
分叉数:
87
简介:
computer vision, image processing and machine learning on the web browser or node.
BBuf/how-to-learn-deep-learning-framework18,249
星标数:
503
分叉数:
30
简介:
how to learn PyTorch and OneFlow
JdeRobot/RoboticsAcademy18,251
语言:
Python
星标数:
503
分叉数:
372
简介:
Learn Robotics with JdeRobot
googlecodelabs/tensorflow-for-poets-218,259
语言:
Python
星标数:
503
分叉数:
449
关键参数与规格
关键参数与规格
参数值
语言Jupyter Notebook
类别Tutorials
子类别ML/AI fundamentals
关键词Diffusion
星标数504
分叉数72
贡献者2
创建日期2018-04-17
更新日期2026-10-11
1 天星标数0
7 天星标数1
排名18,244
上次排名17,995
排名变化-249
7 天星标排名11,609
上次 7 天星标排名11,657
7 天星标排名变化48
总星标排名19,261
上次总星标排名19,233
总星标排名变化-28
国家USA
README 摘录

5 Annotated implementations with comparative introductions for minimax, non-saturating, wasserstein, wasserstein gradient penalty, least squares, deep regret analytic, bounded equilibrium, relativistic, f-divergence, Fisher, and information generative adversarial networks (GANs), and standard, variational, and bounded information rate variational autoencoders (VAEs). Paper links are supplied at the beginning of each file with a short summary of the paper. See src folder for files to run via terminal, or notebooks folder for Jupyter notebook visualizations via your local browser. The main

file changes can be see in the , , and of the Trainer class, although changes are not completely limited to only these two areas (e. Wasserstein GAN clamps weight in the train function, BEGAN gives multiple outputs from train_D, fGAN has a slight modification in viz_loss function to indicate method used in title). All code in this repository operates in a generative, unsupervised manner on binary (black and white) MNIST. The architectures are compatible with a variety of datatypes

(1D, 2D, square 3D images). Plotting functions work with binary/RGB images. If a GPU is detected, the models use it. VAE Trainer classes contain methods to visualize latent space representations (see function). Usage To initialize an environment: For playing around in Jupyer notebooks: To run from Terminal: New Models One of the primary purposes of this repository is to make implementing deep generative model (i. , GAN/VAE) variants as easy as possible. This is possible because, typically but not

always (e. BIRVAE), the proposed modifications only apply to the way loss is computed for backpropagation. Thus, the core training class is structured in such a way that most new implementations should only require edits to the and functions of GAN Trainer classes, and the function of VAE Trainer classes. Suppose we have a non-saturating GAN and we wanted to implement a least-squares GAN. To do this, all we have to do is change two lines: Original (NSGAN

) New (LSGAN) Model Architecture The architecture chosen in these implementations for both the generator (G) and discriminator (D) consists of a simple, two-layer feedforward network. While this will give sensible output for MNIST, in practice it is recommended to use deep convolutional architectures (i. This can be done by editing the Generator and Discriminator classes for GANs, or the Encoder and Decoder classes for VAEs. Visualization All models were trained for 25 epochs with hidden dimension 400, latent dimension

20. Other implementation specifics are as close to the respective original paper (linked) as possible.

常见问题

记录了多少星标和分叉?

shayneobrien/generative-models 有 504 个星标和 72 个分叉。

仓库排名是多少?

shayneobrien/generative-models 排名第 18,244。

记录的语言和类别是什么?

shayneobrien/generative-models 有 504 个星标,语言为 Jupyter Notebook,类别为 Tutorials。

哪个仓库排名最接近?

shayneobrien/generative-models 与 wellflat/imageprocessing-labs 比较,后者排名第 18,247,有 504 个星标。

README

Overview

PyTorch 0.4.1 | Python 3.6.5

Annotated implementations with comparative introductions for minimax, non-saturating, wasserstein, wasserstein gradient penalty, least squares, deep regret analytic, bounded equilibrium, relativistic, f-divergence, Fisher, and information generative adversarial networks (GANs), and standard, variational, and bounded information rate variational autoencoders (VAEs).

Paper links are supplied at the beginning of each file with a short summary of the paper. See src folder for files to run via terminal, or notebooks folder for Jupyter notebook visualizations via your local browser. The main file changes can be see in the train, train_D, and train_G of the Trainer class, although changes are not completely limited to only these two areas (e.g. Wasserstein GAN clamps weight in the train function, BEGAN gives multiple outputs from train_D, fGAN has a slight modification in viz_loss function to indicate method used in title).

All code in this repository operates in a generative, unsupervised manner on binary (black and white) MNIST. The architectures are compatible with a variety of datatypes (1D, 2D, square 3D images). Plotting functions work with binary/RGB images. If a GPU is detected, the models use it. Otherwise, they default to CPU. VAE Trainer classes contain methods to visualize latent space representations (see make_all function).

Usage

To initialize an environment:

python -m venv env  
. env/bin/activate  
pip install -r requirements.txt  

For playing around in Jupyer notebooks:

jupyter notebook

To run from Terminal:

cd src
python bir_vae.py

New Models

One of the primary purposes of this repository is to make implementing deep generative model (i.e., GAN/VAE) variants as easy as possible. This is possible because, typically but not always (e.g. BIRVAE), the proposed modifications only apply to the way loss is computed for backpropagation. Thus, the core training class is structured in such a way that most new implementations should only require edits to the train_D and train_G functions of GAN Trainer classes, and the compute_batch function of VAE Trainer classes.

Suppose we have a non-saturating GAN and we wanted to implement a least-squares GAN. To do this, all we have to do is change two lines:

Original (NSGAN)

def train_D(self, images):
  ...
  D_loss = -torch.mean(torch.log(DX_score + 1e-8) + torch.log(1 - DG_score + 1e-8))

  return D_loss
def train_G(self, images):
  ...
  G_loss = -torch.mean(torch.log(DG_score + 1e-8))

  return G_loss

New (LSGAN)

def train_D(self, images):
  ...
  D_loss = (0.50 * torch.mean((DX_score - 1.)**2)) + (0.50 * torch.mean((DG_score - 0.)**2))

  return D_loss
def train_G(self, images):
  ...
  G_loss = 0.50 * torch.mean((DG_score - 1.)**2)

  return G_loss

Model Architecture

The architecture chosen in these implementations for both the generator (G) and discriminator (D) consists of a simple, two-layer feedforward network. While this will give sensible output for MNIST, in practice it is recommended to use deep convolutional architectures (i.e. DCGANs) to get nicer outputs. This can be done by editing the Generator and Discriminator classes for GANs, or the Encoder and Decoder classes for VAEs.

Visualization

All models were trained for 25 epochs with hidden dimension 400, latent dimension 20. Other implementation specifics are as close to the respective original paper (linked) as possible.

Model Epoch 1 Epoch 25 Progress Loss
MMGAN
NSGAN
WGAN
WGPGAN
DRAGAN
BEGAN
LSGAN
RaNSGAN
FisherGAN
InfoGAN
f-TVGAN
f-PearsonGAN
f-JSGAN
f-ForwGAN
f-RevGAN
f-HellingerGAN
VAE
BIRVAE

To Do

Models: CVAE, denoising VAE, adversarial autoencoder | Bayesian GAN, Self-attention GAN, Primal-Dual Wasserstein GAN
Architectures: Add DCGAN option
Datasets: Beyond MNIST

排名相邻
同类项目