Skip to content

Commit

Permalink
fix: trange and clip_value input. (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabclmnt committed Aug 16, 2021
1 parent 9a0a1d2 commit c816150
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ydata_synthetic/synthesizers/regular/wgan/model.py
@@ -1,7 +1,7 @@
import os
from os import path
import numpy as np
from tqdm import tqdm
from tqdm import trange

from ydata_synthetic.synthesizers import gan

Expand All @@ -27,10 +27,11 @@ def compute_output_shape(self, input_shape):

class WGAN(gan.Model):

def __init__(self, model_parameters, n_critic):
def __init__(self, model_parameters, n_critic, clip_value=0.01):
# As recommended in WGAN paper - https://arxiv.org/abs/1701.07875
# WGAN-GP - WGAN with Gradient Penalty
self.n_critic = n_critic
self.clip_value = clip_value
super().__init__(model_parameters)

def wasserstein_loss(self, y_true, y_pred):
Expand Down Expand Up @@ -90,7 +91,7 @@ def train(self, data, train_arguments):
fake = -np.ones((self.batch_size, 1))

with train_summary_writer.as_default():
for epoch in tqdm.trange(epochs, desc='Epoch Iterations'):
for epoch in trange(epochs, desc='Epoch Iterations'):

for _ in range(self.n_critic):
# ---------------------
Expand Down

0 comments on commit c816150

Please sign in to comment.