Skip to content

Subject: Possible indentation issue in Chapter 7, Example 7-4 #60

@BasilAlj

Description

@BasilAlj

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions