def build_generator():
model = Sequential()
# Takes in random values and reshapes it to 7x7x128
# Beginnings of a generated image
model.add(Dense(77128, input_dim=128))
model.add(LeakyReLU(0.2))
model.add(Reshape((7,7,128)))
Model: "sequential_5"
Layer (type) Output Shape Param
dense_5 (Dense) (None, 6272) 809088
def build_discriminator():
model = Sequential()
model.add(Conv2D(32, 5, input_shape=(28,28,1)))
model.add(LeakyReLU(.2))
model.add(Dropout(.4))
Model: "sequential_8"
Layer (type) Output Shape Param
conv2d_33 (Conv2D) (None, 24, 24, 32) 832
Based on the summary of both generator and discriminator, the input dim for the generator is 2, and the input dim for the discriminator is 4. However, the codes were defined with input of generator and discriminator both 3 and 3, which ended up with error message. Hence, suggesting to change the code with generator and discriminator input img = generator.predict(np.random.randn(4,128))
def build_generator():
model = Sequential()
# Takes in random values and reshapes it to 7x7x128
# Beginnings of a generated image
model.add(Dense(77128, input_dim=128))
model.add(LeakyReLU(0.2))
model.add(Reshape((7,7,128)))
Model: "sequential_5"
Layer (type) Output Shape Param
dense_5 (Dense) (None, 6272) 809088
def build_discriminator():
model = Sequential()
model.add(Conv2D(32, 5, input_shape=(28,28,1)))
model.add(LeakyReLU(.2))
model.add(Dropout(.4))
Model: "sequential_8"
Layer (type) Output Shape Param
conv2d_33 (Conv2D) (None, 24, 24, 32) 832
Based on the summary of both generator and discriminator, the input dim for the generator is 2, and the input dim for the discriminator is 4. However, the codes were defined with input of generator and discriminator both 3 and 3, which ended up with error message. Hence, suggesting to change the code with generator and discriminator input
img = generator.predict(np.random.randn(4,128))