Skip to content

Instantly share code, notes, and snippets.

@lucidrains
Created April 29, 2020 01:28
Show Gist options
  • Save lucidrains/523b5c550eb88df6018911c3ccad4e6b to your computer and use it in GitHub Desktop.
Save lucidrains/523b5c550eb88df6018911c3ccad4e6b to your computer and use it in GitHub Desktop.
w = mapping_network(z) # (batch, depth, dim)
nonlinear = nn.Sequential(
nn.Linear(dim, dim, bias=False),
nn.LeakyRelu(),
nn.Linear(dim, init_channel_dim * 4)
)
init_image_block = nonlinear(mean(w, dim=1)).reshape(batch, 2, 2, init_channel_dim)
# i then modified my generator network to start at 2x2 instead of 4x4, but i guess you can upsample with a convtranspose2d here for simplicity
# for some reason, if i directly go from nonlinear -> 4x4, it doesn't learn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment