Skip to content

Commit c816150

Browse files
authored
fix: trange and clip_value input. (#72)
1 parent 9a0a1d2 commit c816150

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • src/ydata_synthetic/synthesizers/regular/wgan

src/ydata_synthetic/synthesizers/regular/wgan/model.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
from os import path
33
import numpy as np
4-
from tqdm import tqdm
4+
from tqdm import trange
55

66
from ydata_synthetic.synthesizers import gan
77

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

2828
class WGAN(gan.Model):
2929

30-
def __init__(self, model_parameters, n_critic):
30+
def __init__(self, model_parameters, n_critic, clip_value=0.01):
3131
# As recommended in WGAN paper - https://arxiv.org/abs/1701.07875
3232
# WGAN-GP - WGAN with Gradient Penalty
3333
self.n_critic = n_critic
34+
self.clip_value = clip_value
3435
super().__init__(model_parameters)
3536

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

9293
with train_summary_writer.as_default():
93-
for epoch in tqdm.trange(epochs, desc='Epoch Iterations'):
94+
for epoch in trange(epochs, desc='Epoch Iterations'):
9495

9596
for _ in range(self.n_critic):
9697
# ---------------------

0 commit comments

Comments
 (0)