mirror of
https://github.com/wassname/denoising-diffusion-pytorch.git
synced 2026-09-09 11:21:11 +08:00
Added gradient clipping.
This commit is contained in:
@@ -845,6 +845,7 @@ class Trainer(object):
|
||||
|
||||
self.accelerator.backward(loss)
|
||||
|
||||
accelerator.clip_grad_norm_(self.model.parameters(), 1.0)
|
||||
pbar.set_description(f'loss: {total_loss:.4f}')
|
||||
|
||||
accelerator.wait_for_everyone()
|
||||
|
||||
Reference in New Issue
Block a user