Hello David Foster,
I am studying Chapter 7, “Energy-Based Models,” from Generative Deep Learning, 2nd edition, and I noticed a possible indentation issue in Example 7-4, “The Langevin Sampling Function.”
In the displayed code, the line:
return inp_imgs
appears to be indented inside the for loop. If this is the intended code structure, the function would return after the first Langevin step and would not complete all iterations specified by steps.
My understanding is that the function should complete all Langevin update steps first, then return the final updated inp_imgs after the loop finishes. So the return statement may need to be dedented outside the for loop.
I wanted to report this in case it is a formatting or indentation error in the book/example.
Thank you for the excellent material.
Best regards,
Basil
Hello David Foster,
I am studying Chapter 7, “Energy-Based Models,” from Generative Deep Learning, 2nd edition, and I noticed a possible indentation issue in Example 7-4, “The Langevin Sampling Function.”
In the displayed code, the line:
return inp_imgs
appears to be indented inside the for loop. If this is the intended code structure, the function would return after the first Langevin step and would not complete all iterations specified by steps.
My understanding is that the function should complete all Langevin update steps first, then return the final updated inp_imgs after the loop finishes. So the return statement may need to be dedented outside the for loop.
I wanted to report this in case it is a formatting or indentation error in the book/example.
Thank you for the excellent material.
Best regards,
Basil