Skip to content

Commit

Permalink
fix: annotated-diffusion - norm weights should divide by variance (#1526
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kwikwag authored Oct 28, 2023
1 parent d3b6ae2 commit cb6683e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion annotated-diffusion.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class WeightStandardizedConv2d(nn.Conv2d):
weight = self.weight
mean = reduce(weight, "o ... -> o 1 1 1", "mean")
var = reduce(weight, "o ... -> o 1 1 1", partial(torch.var, unbiased=False))
normalized_weight = (weight - mean) * (var + eps).rsqrt()
normalized_weight = (weight - mean) / (var + eps).rsqrt()

return F.conv2d(
x,
Expand Down

0 comments on commit cb6683e

Please sign in to comment.