Skip to content

Commit

Permalink
training
Browse files Browse the repository at this point in the history
  • Loading branch information
lllyasviel committed Feb 21, 2023
1 parent 75b6c17 commit a3427f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/train.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,11 @@ However, this option is also very useful when you are training on images with so
Also, if your dataset is large, you may want to end the training with a few thousands of steps with those layer unlocked. This usually improve the "problem-specific" solutions a little. You may try it yourself to feel the difference.

Also, if you unlock some original layers, you may want a lower learning rate, like 2e-6.

## Other Considerations: the sudden converge phenomenon and gradient accumulation

![img](../github_page/ex1.jpg)

Because we use zero convolutions, the SD should always be able to predict meaningful images. You will always find that at some iterations, the model "suddenly" be able to fit some training conditions. This means that you will get a basically usable model at about 3k to 7k steps (future training will improve it, but that model after the first "sudden converge" should be basically functional).

Note that 3k to 7k steps is not very large, and you should consider larger batch size rather than more training steps. If you can observe the fitting at 3k step, rather than train it with 300k steps, a better idea is to use 100× gradient accumulation to train that 3k steps with 100× batch size. Note that perhaps we should not do this *too* extremely, but you should consider that, since "sudden converge" will always happen at some point, getting a better converge is more important.
Binary file added github_page/ex1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a3427f4

Please sign in to comment.