I'm trying to depth-wise concat (example of implementation in StarGAN using Pytorch) a one-hot vector into an image input, say
input_img = Input(shape = (row, col, chann))
one_hot = Input(shape = (7, ))
I stumbled on the same problem before (it was class indexes), and so I used RepeatVector+Reshape then Concatenate. But I found RepeatVector is not compatible when you want to repeat 3D into 4D (included batch_num
).
How do I implement this method in Keras? I found that Upsampling2D
could do the works, but I don't know if it able to keep the one-hot vector structure during upsampling process