torch.randn generates a tensor of random values drawn from a normal distribution with mean 0 and standard deviation 1. In a diffusion process, these values provide the noise added to progressively distort data. section 10.5
Adding noise during diffusion
def diffuse_points(points, beta): new_mean = torch.sqrt(1-beta) * points noise = torch.randn(points.shape) perturbation = torch.sqrt(beta) * noise points = new_mean + perturbation return points, noise The scaled original points and scaled random noise are added to produce the next state. section 10.5
def diffuse_points(points, beta):
new_mean = torch.sqrt(1-beta) * points
noise = torch.randn(points.shape)
perturbation = torch.sqrt(beta) * noise
points = new_mean + perturbation
return points, noise
Inspect the complete helper that creates normally distributed noise, scales it by beta, and adds it to the input points. section 10.5
