Skip to content

Commit

Permalink
test before you push
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-g committed Feb 11, 2021
1 parent 267e6eb commit 8d1fdb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/WGAN-GP/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ def pred_step(self, x, states):

def train_step(self, x, states):
# training the discriminator on every iteration
d_loss, gp, states = self.discriminator_step_jit(x, states)
d_loss, gp, states = self.discriminator_step(x, states)

step = states.step + 1
no_update = lambda args: (0.0, args[1])
do_update = lambda args: self.generator_step_jit(len(args[0]), args[1])
do_update = lambda args: self.generator_step(len(args[0]), args[1])
g_loss, states = jax.lax.cond(step % 5 == 0, do_update, no_update, (x, states))

return {"d_loss": d_loss, "g_loss": g_loss, "gp": gp}, states.update(step=step)
Expand Down

0 comments on commit 8d1fdb0

Please sign in to comment.