Skip to content

Instantly share code, notes, and snippets.

@Blaizzy
Created May 3, 2020 18:56
Show Gist options
  • Select an option

  • Save Blaizzy/94825b8fab47a8c8b709e7c282e979ea to your computer and use it in GitHub Desktop.

Select an option

Save Blaizzy/94825b8fab47a8c8b709e7c282e979ea to your computer and use it in GitHub Desktop.
def res_block(nf):
return ResSequential(
[conv(nf, nf), conv(nf, nf, actn=False)],
0.1) # conv-> Relu-> conv
#----------------------
def upsample(ni, nf, scale):
layers = []
for i in range(int(math.log(scale,2))):
layers += [conv(ni, nf*4), nn.PixelShuffle(2)]
return nn.Sequential(*layers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment