Code Monkey home page Code Monkey logo

tdpo's Introduction

Temporal Diffusion Policy Optimization (TDPO)

This is an official PyTorch implementation of Temporal Diffusion Policy Optimization (TDPO) from our paper Confronting Reward Overoptimization for Diffusion Models: A Perspective of Inductive and Primacy Biases, which is accepted by ICML 2024.

Installation

Python 3.10 or a newer version is required. In order to install the requirements, create a conda environment and run the setup.py file in this repository, e.g. run the following commands:

conda create -p tdpo python=3.10.12 -y
conda activate tdpo

git clone [email protected]:ZiyiZhang27/tdpo.git
cd tdpo
pip install -e .

Training

To train on Aesthetic Score and evaluate cross-reward generalization by out-of-domain reward functions, run this command:

accelerate launch scripts/train_tdpo.py --config config/config_tdpo.py:aesthetic

To train on PickScore and evaluate cross-reward generalization by out-of-domain reward functions, run this command:

accelerate launch scripts/train_tdpo.py --config config/config_tdpo.py:pickscore

To train on HPSv2 and evaluate cross-reward generalization by out-of-domain reward functions, run this command:

accelerate launch scripts/train_tdpo.py --config config/config_tdpo.py:hpsv2

For detailed explanations of all hyperparameters, please refer to the configuration files config/base_tdpo.py and config/config_tdpo.py. These files are pre-configured for training with 8 x NVIDIA A100 GPUs (each with 40GB of memory).

Note: Some hyperparameters might appear in both configuration files. In such cases, only the values set in config/config_tdpo.py will be used during training as this file has higher priority.

Citation

If you find this work useful in your research, please consider citing:

@inproceedings{zhang2024confronting,
  title={Confronting Reward Overoptimization for Diffusion Models: A Perspective of Inductive and Primacy Biases},
  author={Ziyi Zhang and Sen Zhang and Yibing Zhan and Yong Luo and Yonggang Wen and Dacheng Tao},
  booktitle={Forty-first International Conference on Machine Learning},
  year={2024}
}

Acknowledgement

tdpo's People

Contributors

ziyizhang27 avatar

Stargazers

 avatar JoelleJ avatar Harryis Wang avatar 林楷傑 avatar  avatar  avatar Youxin Xing avatar  avatar

Watchers

Kostas Georgiou avatar  avatar

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.