Giter Club home page Giter Club logo

trajectory-alignment-diffusion's Introduction

Generative models have had a profound impact on vision and language, paving the way for a new era of multimodal generative applications. While these successes have inspired researchers to explore using generative models in science and engineering to accelerate the design process and reduce the reliance on iterative optimization, challenges remain. Specifically, engineering optimization methods based on physics still outperform generative models when dealing with constrained environments where data is scarce and precision is paramount. To address these challenges, we introduce Diffusion Optimization Models (DOM) and Trajectory Alignment (TA), a learning framework that demonstrates the efficacy of aligning the sampling trajectory of diffusion models with the optimization trajectory derived from traditional physics-based methods.

teaser

This repo contains code and experiments for:

Aligning Optimization Trajectories with Diffusion Models for Constrained Design Generation
Giorgio Giannone, Akash Srivastava, Ole Winther, Faez Ahmed
Conference on Neural Information Processing Systems (NeurIPS), 2023

[paper] [code] [page]

Diffusing the Optimal Topology: A Generative Optimization Approach
Giorgio Giannone, Faez Ahmed
International Design Engineering Technical Conferences (IDETC), 2023

[paper] [code]

teaser teaser

teaser


Installation

conda create -n dom python=3.8
conda activate dom

git clone https://github.com/georgosgeorgos/trajectory-alignment-diffusion/
cd trajectory-alignment-diffusion

The code has been tested on Ubuntu 20.04, Pytorch 1.13, and CUDA 11.6


Dataset

  • 2d topology optimization dataset 64x64 - here

teaser


Evaluation

We use the benchmark provided in TopoDiff. Follow the instructions here to download the evaluation set.


Train the model

TRAIN_FLAGS="--batch_size 32 --save_interval 10000 --use_fp16 True"
MODEL_FLAGS="--image_size 64 --num_channels 128 --num_res_blocks 3 --learn_sigma True --dropout 0.3"
DIFFUSION_FLAGS="--diffusion_steps 1000 --noise_schedule cosine"

DATA_FLAGS="--data_dir ./dom_dataset/"


CUDA_VISIBLE_DEVICES=0 \
python scripts/image_train_intermediate_kernel.py $MODEL_FLAGS $DIFFUSION_FLAGS $TRAIN_FLAGS $DATA_FLAGS

Sample the model

#! /bin/sh
MODEL_FLAGS="--image_size 64 --num_channels 128 --num_res_blocks 3 --learn_sigma True --dropout 0.3 --use_fp16 True"
DIFFUSION_FLAGS="--diffusion_steps 1000 --timestep_respacing 100 --noise_schedule cosine"
DATA_FLAGS="--constraints_path ./dom_dataset/test_data/ --num_samples 1800"
CHECKPOINTS_FLAGS="--model_path ./dom_logdir/ema_0.9999_xxxxx.pt"


CUDA_VISIBLE_DEVICES=0 \
python scripts/sample_kernel_relaxation.py $MODEL_FLAGS $DIFFUSION_FLAGS $DATA_FLAGS $CHECKPOINTS_FLAGS

Acknowledgments

A lot of code and ideas were borrowed from:

Citation

@article{giannone2023aligning,
  title={Aligning Optimization Trajectories with Diffusion Models for Constrained Design Generation},
  author={Giannone, Giorgio and Srivastava, Akash and Winther, Ole and Ahmed, Faez},
  journal={arXiv preprint arXiv:2305.18470},
  year={2023}
}
@article{giannone2023diffusing,
  title={Diffusing the optimal topology: A generative optimization approach},
  author={Giannone, Giorgio and Ahmed, Faez},
  journal={arXiv preprint arXiv:2303.09760},
  year={2023}
}

trajectory-alignment-diffusion's People

Contributors

georgosgeorgos avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

decode-mit

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.