lib/models/conv.py [26:58]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if activation == 'relu':
            self.activation = F.relu
        elif activation == 'lrelu':
            self.activation = lambda x: F.leaky_relu(x, 0.2)
        else:
            raise ValueError()

        self.batchnorm = batchnorm

    def forward(self, z):
        x = self.deconv1(z.view(-1,self.n_in,1,1))
        if self.batchnorm:
            x = self.deconv1_bn(x)
        x = self.activation(x)

        x = self.deconv2(x)
        if self.batchnorm:
            x = self.deconv2_bn(x)
        x = self.activation(x)

        x = self.deconv3(x)
        if self.batchnorm:
            x = self.deconv3_bn(x)
        x = self.activation(x)

        x = self.deconv4(x)
        if self.batchnorm:
            x = self.deconv4_bn(x)
        x = self.activation(x)

        x = F.tanh(self.deconv5(x))

        return x
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



lib/models/conv.py [208:240]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if activation == 'relu':
            self.activation = F.relu
        elif activation == 'lrelu':
            self.activation = lambda x: F.leaky_relu(x, 0.2)
        else:
            raise ValueError()

        self.batchnorm = batchnorm

    def forward(self, z):
        x = self.deconv1(z.view(-1,self.n_in,1,1))
        if self.batchnorm:
            x = self.deconv1_bn(x)
        x = self.activation(x)

        x = self.deconv2(x)
        if self.batchnorm:
            x = self.deconv2_bn(x)
        x = self.activation(x)

        x = self.deconv3(x)
        if self.batchnorm:
            x = self.deconv3_bn(x)
        x = self.activation(x)

        x = self.deconv4(x)
        if self.batchnorm:
            x = self.deconv4_bn(x)
        x = self.activation(x)

        x = F.tanh(self.deconv5(x))

        return x
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



