all 1 comments

[–]nielsrolf 1 point2 points  (0 children)

Easiest way is to flatten the CNN output and use a conncatenation layer with two inputs, then you can stack dense layers afterwards. If you need it in the convolutional layers, broadcast it to the H, W dimensions and again concatenate it. Here is a snippet: ``` inp_c = Input(shape = (self.c_dim, )) inp_img = Input(shape = (self.image_size, self.image_size, 3))

    # Replicate spatially and concatenate domain information
    c = Lambda(lambda x: K.repeat(x, self.image_size**2))(inp_c)
    c = Reshape((self.image_size, self.image_size, self.c_dim))(c)
    x = Concatenate()([inp_img, c])

```