openai / guided-diffusion

MIT License
5.9k stars 782 forks source link

zero_module #152

Open MsQueeniee opened 2 weeks ago

MsQueeniee commented 2 weeks ago

为什么要在每一个block中使用zero_module将网络参数清零

Why do we need to use zero_module to zero out the network parameters in each block?

def zeromodule(module): """ Zero out the parameters of a module and return it. """ for p in module.parameters(): p.detach().zero() return module