Skip to content

Commit

Permalink
fix: Fix data preprocessing and dragan performance prints (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabclmnt authored Oct 28, 2021
1 parent c618d90 commit 3c5f1ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion examples/regular/cramergan_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

#Before training the GAN do not forget to apply the required data transformations
#To ease here we've applied a PowerTransformation
data = transformations(data)
_, data, _ = transformations(data)


#For the purpose of this example we will only synthesize the minority class
train_data = data.loc[ data['Class']==1 ].copy()
Expand Down
2 changes: 1 addition & 1 deletion examples/regular/wgan_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#Before training the GAN do not forget to apply the required data transformations
#To ease here we've applied a PowerTransformation
data = transformations(data)
_, data, _ = transformations(data)

#For the purpose of this example we will only synthesize the minority class
train_data = data.loc[ data['Class']==1 ].copy()
Expand Down
8 changes: 4 additions & 4 deletions src/ydata_synthetic/synthesizers/regular/dragan/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ def train(self, data, train_arguments):
batch_data = tf.cast(batch_data, dtype=tf.float32)
d_loss, g_loss = self.train_step(batch_data)

print(
"Epoch: {} | disc_loss: {} | gen_loss: {}".format(
epoch, d_loss, g_loss
))
print(
"Epoch: {} | disc_loss: {} | gen_loss: {}".format(
epoch, d_loss, g_loss
))

if epoch % train_arguments.sample_interval == 0:
# Test here data generation step
Expand Down

0 comments on commit 3c5f1ee

Please sign in to comment.