Skip to content

Commit

Permalink
use multiply instead of add for global context, due to reported artif…
Browse files Browse the repository at this point in the history
…acts
  • Loading branch information
lucidrains committed Jan 1, 2021
1 parent 2388cbb commit eaa76d4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<img src="./sample-512.jpg" width="600px"></img>
<img src="./images/sample-512.jpg" width="600px"></img>

*512x512 flowers after 12 hours of training, 1 gpu*

<img src="./sample-256.jpg" width="400px"></img>
<img src="./images/sample-256.jpg" width="400px"></img>

*256x256 flowers after 12 hours of training, 1 gpu*

<img src="./pizza-512.jpg" width="600px"></img>
<img src="./images/pizza-512.jpg" width="600px"></img>

*Pizza*

Expand Down
4 changes: 2 additions & 2 deletions lightweight_gan/lightweight_gan.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@ def __init__(

self.net = nn.Sequential(
nn.Conv2d(chan_in, chan_intermediate, 1),
nn.LayerNorm((chan_intermediate, 1, 1)),
nn.LeakyReLU(0.1),
nn.Conv2d(chan_intermediate, chan_out, 1),
nn.Sigmoid()
)
def forward(self, x):
context = self.to_k(x)
Expand Down Expand Up @@ -419,7 +419,7 @@ def forward(self, x):

next_res = res + 1
if next_res in residuals:
x = x + residuals[next_res]
x = x * residuals[next_res]

return self.out_conv(x)

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.15.0'
__version__ = '0.16.0'
Binary file removed pizza-512.jpg
Binary file not shown.
Binary file removed sample-256.jpg
Binary file not shown.
Binary file removed sample-512.jpg
Binary file not shown.

0 comments on commit eaa76d4

Please sign in to comment.