yuval-alaluf / SAM

Official Implementation for "Only a Matter of Style: Age Transformation Using a Style-Based Regression Model" (SIGGRAPH 2021) https://arxiv.org/abs/2102.02754

Home Page:https://yuval-alaluf.github.io/SAM/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[code] About the coach.py

diaodeyi opened this issue · comments

Hi , thanks for your great work! There are tow loss.backward() in coach.py, is there any need for loss.backward(retain_graph=True)?
Because the Calculation graph will be cleared after backward() by default

It is ok that the graph will be cleared after the first forward pass. You perform the forward pass, perform backprop, and then clear the graph. And then you repeat the same thing for the cycle pass.

Thanks