Skip to content

Commit

Permalink
DualGAN stashed
Browse files Browse the repository at this point in the history
  • Loading branch information
eriklindernoren committed Apr 23, 2018
1 parent f138d57 commit 1a8569a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions dualgan/dualgan.py
Expand Up @@ -42,7 +42,12 @@ def __init__(self):
self.g2 = self.build_generator()
self.g2.compile(loss='binary_crossentropy', optimizer=optimizer)

# For the combined model we will only train the generator
#-------------------------
# Construct Computational
# Graph of Generators
#-------------------------

# For the combined model we will only train the generators
self.d1.trainable = False
self.d2.trainable = False

Expand All @@ -63,10 +68,10 @@ def __init__(self):
X2_recon = self.g1(X2_translated)

# The combined model (stacked generators and discriminators)
self.combined = Model([X1, X2], [valid1, valid2, X1_recon, X2_recon])
self.combined = Model(inputs=[X1, X2], outputs=[valid1, valid2, X1_recon, X2_recon])
self.combined.compile(loss=[self.wasserstein_loss, self.wasserstein_loss, 'mae', 'mae'],
optimizer=optimizer,
loss_weights=[1, 1, 100, 100])
optimizer=optimizer,
loss_weights=[1, 1, 100, 100])

def build_generator(self):

Expand Down

0 comments on commit 1a8569a

Please sign in to comment.