AstroPile / FlatironMeeting2024

AstroPile meet-up at the Flatiron Institute
https://astropile.github.io/FlatironMeeting2024/
MIT License
2 stars 3 forks source link

[Baselines] Basic diffusion model generative baseline #29

Open ConnorStoneAstro opened 6 months ago

ConnorStoneAstro commented 6 months ago

Basic diffusion model generative baseline

Train a diffusion model as a generative model for one of the datasets in AstroPile

Contacts: @ConnorStoneAstro Participants:

Goals and deliverable

Set up framework to train a diffusion model on an AstroPile formatted dataset. This would be for a single mode.

Resources needed

Going to pick a low dim dataset for the hack. Framework should be usable on any dataset

Detailed description

ConnorStoneAstro commented 6 months ago

Manage to load data Screenshot from 2024-03-28 15-42-19

ConnorStoneAstro commented 6 months ago

Using my laptop to train a model. Using all my CPU

Screenshot from 2024-03-28 16-06-23

ConnorStoneAstro commented 6 months ago

And now I have samples!!! They are bad because I only trained for 5min on CPU

Screenshot from 2024-03-28 16-15-02 Screenshot from 2024-03-28 16-16-03

ConnorStoneAstro commented 6 months ago

Had to hack the score_models package to use an IterableDataset which doesn't have a len value. It's very trivial changes so I will make a PR for score_models

ConnorStoneAstro commented 6 months ago

Also, had to enforce that the spectrum was a power of 2. This is because the default score model is a (1D) U-net, this can be up to the user if you want something fancy.