SinGAN: Learning a Generative Model from a Single Natural Image: Difference between revisions

Line 66: Line 66:
where the initial noise <math>z^*</math> is drawn once and then fixed during the rest of the training.<br>
where the initial noise <math>z^*</math> is drawn once and then fixed during the rest of the training.<br>
The standard deviation <math>\sigma_n</math> of the noise <math>z_n</math> is proportional to the root mean squared error (RMSE) between the reconstructed patch and the original patch.
The standard deviation <math>\sigma_n</math> of the noise <math>z_n</math> is proportional to the root mean squared error (RMSE) between the reconstructed patch and the original patch.
<syntaxhighlight lang="python">
loss = nn.MSELoss()
Z_opt = opt.noise_amp*z_opt+z_prev
rec_loss = alpha*loss(netG(Z_opt.detach(),z_prev),real)
rec_loss.backward(retain_graph=True)
</syntaxhighlight>


==Evaluation==
==Evaluation==