def forward(self, x):
kl_sum = 0
out = x
for l in self.features:
if type(l).__name__.startswith("Rand"):
out, kl = l.forward(out)
if kl is not None:
kl_sum += kl
else:
out = l.forward(out)
out = out.view(out.size(0), -1)
out, kl = self.classifier.forward(out)
kl_sum += kl
return out, kl
I guess kl, one of the return values, should be kl_sum.
I am looking forward to explanations :)
In the code "BayesianDefense/models/vgg_vi.py",
I guess kl, one of the return values, should be kl_sum. I am looking forward to explanations :)
Thanks, HarryKim