neka-nat / image_completion_tf2

"Globally and Locally Consistent Image Completion" with Tensorflow2 Keras
31 stars 11 forks source link

A keras question about bulid network #9

Closed xieenze closed 5 years ago

xieenze commented 6 years ago

hello neka-nat.

In the train.py line 98 and 99. your code is ''' d_container = Container([org_img, in_pts], discriminator([org_img, in_pts])) d_model = Model([org_img, in_pts], d_container([org_img, in_pts])) ''' in line 76 you create discriminator.'discriminator = model_discriminator(input_shape, local_shape)' can you tell me the difference between discriminator and d_model?

I am confused about why you such design discriminator and d_model. Please tell me if you are free. Thanks #

xieenze commented 6 years ago

I see the discriminator.summary and d_model.summary I found that they have same params: 45,070,593

neka-nat commented 6 years ago

Hi, xieenze. There is no difference discriminator and d_container. Container have the role of putting layers together. If I didn't use container, you would need to set parameters that was not learned as follows.

for l in discriminator.layers:
    l.trainable = False

When using a container you can write d_container.trainable = False.