Complete the code to add noise to the data in a diffusion model step.
noisy_data = data + [1] * noiseIn diffusion models, noise is added gradually. A common noise scale is 0.5 for a moderate noise level.
Complete the code to reverse the diffusion process by denoising the noisy data.
denoised_data = model.predict([1])The model predicts the clean data from the noisy input, so it takes noisy_data as input.
Fix the error in the training loss calculation for the diffusion model.
loss = loss_fn([1], predicted_noise)The loss compares the predicted noise to the actual noise added, so the first argument is noise.
Fill both blanks to create a dictionary comprehension that maps each step to its noise level if the noise level is less than 0.5.
noise_levels = {step: [1] for step, noise in steps.items() if noise [2] 0.5}The dictionary maps step to noise only if noise is less than 0.5, so we use noise and <.
Fill all three blanks to create a dictionary comprehension that maps each step's name in uppercase to its noise value if noise is greater than 0.3.
filtered_noise = { [1]: [2] for step, [3] in steps.items() if noise > 0.3 }The key is step.upper(), the value is noise, and the loop unpacks step and noise.