@@ -115,7 +115,7 @@ def log_validation(vae, text_encoder, tokenizer, unet, args, accelerator, weight
115115def parse_args ():
116116 parser = argparse .ArgumentParser (description = "Simple example of a training script." )
117117 parser .add_argument (
118- "--input_pertubation " , type = float , default = 0 , help = "The scale of input pretubation . Recommended 0.1."
118+ "--input_perturbation " , type = float , default = 0 , help = "The scale of input perturbation . Recommended 0.1."
119119 )
120120 parser .add_argument (
121121 "--pretrained_model_name_or_path" ,
@@ -830,16 +830,16 @@ def collate_fn(examples):
830830 noise += args .noise_offset * torch .randn (
831831 (latents .shape [0 ], latents .shape [1 ], 1 , 1 ), device = latents .device
832832 )
833- if args .input_pertubation :
834- new_noise = noise + args .input_pertubation * torch .randn_like (noise )
833+ if args .input_perturbation :
834+ new_noise = noise + args .input_perturbation * torch .randn_like (noise )
835835 bsz = latents .shape [0 ]
836836 # Sample a random timestep for each image
837837 timesteps = torch .randint (0 , noise_scheduler .config .num_train_timesteps , (bsz ,), device = latents .device )
838838 timesteps = timesteps .long ()
839839
840840 # Add noise to the latents according to the noise magnitude at each timestep
841841 # (this is the forward diffusion process)
842- if args .input_pertubation :
842+ if args .input_perturbation :
843843 noisy_latents = noise_scheduler .add_noise (latents , new_noise , timesteps )
844844 else :
845845 noisy_latents = noise_scheduler .add_noise (latents , noise , timesteps )
0 commit comments