May 2019
Intermediate to advanced
272 pages
7h 19m
English
To train the model, we use the following steps:
real_inputs = Input(shape=img_shape) txt_inputs = Input(shape=emb_shape) txt_shuf_inputs = Input(shape=emb_shape) z_inputs = Input(shape=(z_dim, ))
fake_samples = G([z_inputs, txt_inputs]) D_real = D([real_inputs, txt_inputs]) D_wrong = D([real_inputs, txt_shuf_inputs]) D_fake = D([fake_samples, txt_inputs])
G.trainable = False D.trainable = True D_model = Model(inputs=[real_inputs, txt_inputs, txt_shuf_inputs, z_inputs], outputs=[D_real, D_wrong, D_fake])
Read now
Unlock full access