mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-09 06:45:09 +00:00
(ACTUAL) Min-SNR Weighting Strategy: Fixed SNR calculation to authors implementation
This commit is contained in:
@@ -306,7 +306,7 @@ def train(args):
|
||||
loss = torch.nn.functional.mse_loss(noise_pred.float(), target.float(), reduction="mean")
|
||||
|
||||
if args.min_snr_gamma:
|
||||
loss = apply_snr_weight(loss, latents, noisy_latents, args.min_snr_gamma)
|
||||
loss = apply_snr_weight(loss, timesteps, noise_scheduler, args.min_snr_gamma)
|
||||
|
||||
accelerator.backward(loss)
|
||||
if accelerator.sync_gradients and args.max_grad_norm != 0.0:
|
||||
|
||||
Reference in New Issue
Block a user