Skip to contents

Latent -> projection -> spatial seed -> transposed-conv stack, batch norm + ReLU on every layer but the last, tanh on the output (which is why DCGAN data is scaled to [-1, 1]). The batch norm here is the whole-tensor population form, as in Python.

Usage

morie_geron_dcgan_generator(
  z,
  weights,
  seed_shape = NULL,
  stride = 2,
  batch_norm = TRUE
)

Arguments

z

Latent vector.

weights

List: projection matrix then kernels.

seed_shape

Optional c(h0, w0).

stride

Upsampling stride.

batch_norm

Apply batch norm on hidden layers.

Value

List with image, image_shape, seed, layer_shapes, upsample_factor, latent_dim.

Examples

morie_geron_dcgan_generator(z = 5L, weights = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $image
#>      [,1]
#> [1,]    0
#> 
#> $image_shape
#> [1] 1 1
#> 
#> $seed
#>      [,1]
#> [1,]    5
#> 
#> $layer_shapes
#> $layer_shapes[[1]]
#> [1] 1 1
#> 
#> $layer_shapes[[2]]
#> [1] 1 1
#> 
#> $layer_shapes[[3]]
#> [1] 1 1
#> 
#> $layer_shapes[[4]]
#> [1] 1 1
#> 
#> $layer_shapes[[5]]
#> [1] 1 1
#> 
#> $layer_shapes[[6]]
#> [1] 1 1
#> 
#> $layer_shapes[[7]]
#> [1] 1 1
#> 
#> $layer_shapes[[8]]
#> [1] 1 1
#> 
#> 
#> $upsample_factor
#> [1] 1
#> 
#> $latent_dim
#> [1] 1
#> 
#> $estimate
#> [1] 0
#> 
#> $n
#> [1] 1
#> 
#> $method
#> [1] "DCGAN generator forward pass"
#>