Skip to content

Instantly share code, notes, and snippets.

@mdfarragher
Created December 13, 2019 15:54
Show Gist options
  • Save mdfarragher/d60e821dbca50f3747f460cba17ad369 to your computer and use it in GitHub Desktop.
Save mdfarragher/d60e821dbca50f3747f460cba17ad369 to your computer and use it in GitHub Desktop.
// create the generator
var generator = generatorVar
.Dense(128 * 16 * 16, v => CNTK.CNTKLib.LeakyReLU(v, 0.1))
.Reshape(new int[] { 16, 16, 128 })
.Convolution2D(256, new int[] { 5, 5 }, padding: true, activation: v => CNTK.CNTKLib.LeakyReLU(v, 0.1))
.ConvolutionTranspose(
filterShape: new int[] { 4, 4 },
numberOfFilters: 256,
strides: new int[] { 2, 2 },
outputShape: new int[] { 32, 32 },
padding: true,
activation: v => CNTK.CNTKLib.LeakyReLU(v, 0.1)
)
.Convolution2D(256, new int[] { 5, 5 }, padding: true, activation: v => CNTK.CNTKLib.LeakyReLU(v, 0.1))
.Convolution2D(256, new int[] { 5, 5 }, padding: true, activation: v => CNTK.CNTKLib.LeakyReLU(v, 0.1))
.Convolution2D(channels, new int[] { 7, 7 }, padding: true, activation: CNTK.CNTKLib.Tanh)
.ToNetwork();
// the rest of the code goes here...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment