Git Product home page Git Product logo

zhaohuiqiao0517 / guided-text-generation-with-classifier-free-language-diffusion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vvhg1/guided-text-generation-with-classifier-free-language-diffusion

0.0 0.0 0.0 66.97 MB

Exploring classifier-free guidance in a DDPM language model for text generation towards emotion targets.

Shell 0.24% C++ 0.02% Python 98.05% C 0.02% Cuda 0.19% Makefile 0.01% Jupyter Notebook 1.43% Dockerfile 0.03% Jsonnet 0.01%

guided-text-generation-with-classifier-free-language-diffusion's Introduction

Guided Text Generation with Classifier-free Language Diffusion

Author: Victor v. Hobe-Gelting

This repository builds on and is an adaptation of code from:

Diffusion-LM Improves Controllable Text Generation

Repository: https://github.com/XiangLi1999/Diffusion-LM

Paper: https://arxiv.org/pdf/2205.14217.pdf



Denoising Diffusion Probabilistic Models

Repository: https://github.com/hojonathanho/diffusion

Paper: https://arxiv.org/abs/2006.11239



Improved Denoising Diffusion Probabilistic Models

Repository: https://github.com/openai/improved-diffusion

Paper: https://arxiv.org/abs/2102.09672



Diffusion Models Beat GANS on Image Synthesis

Repository: https://github.com/openai/guided-diffusion

Paper: https://arxiv.org/abs/2105.05233



GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Models

Repository: https://github.com/openai/glide-text2im

Paper: https://arxiv.org/abs/2112.10741



GLID-3

Repository: https://github.com/Jack000/glid-3



Conda Setup:

conda install -c conda-forge mpi4py
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
pip install -e improved-diffusion/
pip install -e transformers/
pip install spacy==3.2.4
pip install datasets==1.8.0
pip install huggingface_hub==0.4.0
pip install wandb

Train Diffusion-LM:

cd improved-diffusion;

python scripts/run_train.py --diff_steps 2000 --model_arch transformer --lr 0.0001 --lr_anneal_steps 400000 --save_interval 50000 --seed 101 --noise_schedule sqrt --in_channel 128 --modality roc-free --submit no --padding_mode pad --app "--predict_xstart True --training_mode e2e --vocab_size 11043 --roc_train datasets/ROCstory " --notes xstart_e2e --bsz 64


Controllable Text Generation

python scripts/infill_free.py --model_path 'diffusion_models/diff_roc-free_pad_rand128_transformer_lr0.0001_0.0_2000_sqrt_Lsimple_h128_s2_d0.1_sd101_xstart_e2e/model{model epochs}.pt' --eval_task_ 'free_emotion' --use_ddim True --notes "tree_adagrad" --eta 1. --verbose pipe


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.