small helper fn to make sampling more clear

This commit is contained in:
Phil Wang
2020-09-07 16:40:36 -07:00
parent e700a7c6de
commit d70fb08f8a
2 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -34,8 +34,8 @@ loss = diffusion(training_images)
loss.backward()
# after a lot of training
sampled_images = diffusion.p_sample_loop((1, 3, 128, 128))
sampled_images.shape # (1, 3, 128, 128)
sampled_images = diffusion.sample(128, batch_size = 4)
sampled_images.shape # (4, 3, 128, 128)
```
Or, if you simply want to pass in a folder name and the desired image dimensions, you can use the `Trainer` class to easily train a model.