Skip to content

Commit

Permalink
make sure intermediate channel in frequency channel attention module …
Browse files Browse the repository at this point in the history
…is at minimum 3
  • Loading branch information
lucidrains committed Jan 16, 2021
1 parent ea6f1a7 commit dd235e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lightweight_gan/lightweight_gan.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,17 @@ def __init__(
width
):
super().__init__()

freq_w, freq_h = ([0] * 8), list(range(8)) # in paper, it seems 16 frequencies was ideal
dct_weights = get_dct_weights(width, chan_in, [*freq_w, *freq_h], [*freq_h, *freq_w])
self.register_buffer('dct_weights', dct_weights)

chan_intermediate = max(3, chan_out // reduction)

self.net = nn.Sequential(
nn.Conv2d(chan_in, chan_out // reduction, 1),
nn.Conv2d(chan_in, chan_intermediate, 1),
nn.LeakyReLU(0.1),
nn.Conv2d(chan_out // reduction, chan_out, 1),
nn.Conv2d(chan_intermediate, chan_out, 1),
nn.Sigmoid()
)

Expand Down
2 changes: 1 addition & 1 deletion lightweight_gan/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.17.1'
__version__ = '0.17.2'

0 comments on commit dd235e8

Please sign in to comment.