-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(adult): Add WGANGP example with adult census dataset.
- Loading branch information
Showing
2 changed files
with
31 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from ydata_synthetic.preprocessing.adult import transformations | ||
from ydata_synthetic.synthesizers import WGAN_GP | ||
|
||
#Load and process the data | ||
data, processed_data, preprocessor = transformations() | ||
|
||
# WGAN_GP training | ||
#Defininf the training parameters of WGAN_GP | ||
|
||
noise_dim = 32 | ||
dim = 128 | ||
batch_size = 128 | ||
|
||
log_step = 100 | ||
epochs = 200+1 | ||
learning_rate = 5e-4 | ||
beta_1 = 0.5 | ||
beta_2 = 0.9 | ||
models_dir = './cache' | ||
|
||
gan_args = [batch_size, learning_rate, beta_1, beta_2, noise_dim, processed_data.shape[1], dim] | ||
train_args = ['', epochs, log_step] | ||
|
||
synthesizer = WGAN_GP(gan_args, n_critic=2) | ||
synthesizer.train(processed_data, train_args) | ||
|
||
synth_data = synthesizer.sample(1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters