Skip to content

Code to recreate results from "Unpaired Downscaling of Fluid Flows with Diffusion Bridges", Bischoff & Deck (2023). R&D project that shows how diffusion bridges can be applied to fluid simulations.

License

Notifications You must be signed in to change notification settings

CliMA/diffusion-bridge-downscaling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Diffusion-bridge-downscaling

Code repository for the preprint "Unpaired Downscaling of Fluid Flows with Diffusion Bridges", Bischoff & Deck (2023). In order to train model, follow the the steps below.

  1. Navigate to CliMAgen.jl/examples/context2dturbulence.

  2. Setup Julia Project via:
    julia --project -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.precompile'

  3. Model training:
    julia --project training.jl Experiment_512x512.toml

  4. Computing and saving statistics of training images: In order to generate statistics from all of the training data, using 2000 pixels from each image, for the wavenumber 16 dataset,
    julia --project analyze_train_by_batch.jl 2000 16 Experiment_512x512.toml.
    The model is not used in this process, but the Experiment.toml specifies where the preprocessing parameter file is stored. By default, our dataloader preprocesses the data, so the inverse transformation is required before computing statistics.

  5. Computing and saving statistics of generated images: In order to generate statistics from 32 batches of 25 images, using 2000 pixels from each image, for the wavenumber 16 dataset,
    julia --project analyze_gen_by_batch.jl 32 2000 16 Experiment_512x512.toml

  6. Computing and saving statistics of downscaled images: In order to generate statistics for 32 batches of 25 downscaled images, using 2000 pixels from each image, for the wavenumber 16 dataset,
    julia --project analyze_downscaled_by_batch.jl 32 2000 16 Experiment_64x64.toml Experiment_512x512.toml
    Again, no model is required for the low-resolution dataset, but the Experiment_64x64.toml specifies where the preprocessing parameter file is stored. By default, our dataloader preprocesses the data, so the inverse transformation is required before computing statistics.

This generates approximately the same number of samples in the training statistics, generated statistics, and downscaled statistics. While the code does run on the CPU, we recommend running on a GPU. Parameter choices for training, for the diffusion model, and for sampling are in the experiment TOML files.

About

Code to recreate results from "Unpaired Downscaling of Fluid Flows with Diffusion Bridges", Bischoff & Deck (2023). R&D project that shows how diffusion bridges can be applied to fluid simulations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages