Skip to content

Commit 2f6fd89

Browse files
authored
chore: fix running examples (#272)
* chore: fix examples. * chore: udt ctgan training epochs
1 parent 5c94e91 commit 2f6fd89

5 files changed

Lines changed: 3 additions & 8 deletions

File tree

examples/regular/models/creditcard_cgan.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
'V3', 'V22', 'V6', 'V20', 'V27', 'V16', 'V13', 'V25', 'V24', 'V18', 'V2', 'V1', 'V5', 'V15',
2222
'V9', 'V23', 'Class']
2323
processed_data = data[ sorted_cols ].copy()
24-
processed_data['Class'] = processed_data['Class'].apply(lambda x: 1 if x == "'1'" else 0)
2524

2625
#For the purpose of this example we will only synthesize the minority class
2726
train_data = processed_data.loc[processed_data['Class'] == 1].copy()
@@ -47,7 +46,7 @@
4746
beta_2 = 0.9
4847

4948
log_step = 100
50-
epochs = 500 + 1
49+
epochs = 2 + 1
5150
learning_rate = 5e-4
5251
models_dir = '../cache'
5352

examples/regular/models/creditcard_cramergan.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
print('Dataset columns: {}'.format(num_cols))
2323
sorted_cols = ['V14', 'V4', 'V10', 'V17', 'V12', 'V26', 'Amount', 'V21', 'V8', 'V11', 'V7', 'V28', 'V19', 'V3', 'V22', 'V6', 'V20', 'V27', 'V16', 'V13', 'V25', 'V24', 'V18', 'V2', 'V1', 'V5', 'V15', 'V9', 'V23', 'Class']
2424
processed_data = data[ sorted_cols ].copy()
25-
processed_data['Class'] = processed_data['Class'].apply(lambda x: 1 if x == "'1'" else 0)
2625

2726
#For the purpose of this example we will only synthesize the minority class
2827
train_data = processed_data.loc[processed_data['Class'] == 1].copy()
@@ -45,7 +44,7 @@
4544
batch_size = 128
4645

4746
log_step = 100
48-
epochs = 2+1
47+
epochs = 500+1
4948
learning_rate = 5e-4
5049
beta_1 = 0.5
5150
beta_2 = 0.9

examples/regular/models/creditcard_ctgan.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
'V3', 'V22', 'V6', 'V20', 'V27', 'V16', 'V13', 'V25', 'V24', 'V18', 'V2', 'V1', 'V5', 'V15',
2222
'V9', 'V23', 'Class']
2323
processed_data = data[ sorted_cols ].copy()
24-
processed_data['Class'] = processed_data['Class'].apply(lambda x: 1 if x == "'1'" else 0)
2524

2625
# For the purpose of this example we will only synthesize the minority class
2726
train_data = processed_data.loc[processed_data['Class'] == 1].copy()

examples/regular/models/creditcard_cwgangp.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
print('Dataset columns: {}'.format(num_cols))
1818
sorted_cols = ['V14', 'V4', 'V10', 'V17', 'V12', 'V26', 'Amount', 'V21', 'V8', 'V11', 'V7', 'V28', 'V19', 'V3', 'V22', 'V6', 'V20', 'V27', 'V16', 'V13', 'V25', 'V24', 'V18', 'V2', 'V1', 'V5', 'V15', 'V9', 'V23', 'Class']
1919
processed_data = data[ sorted_cols ].copy()
20-
processed_data['Class'] = processed_data['Class'].apply(lambda x: 1 if x == "'1'" else 0)
2120

2221
#For the purpose of this example we will only synthesize the minority class
2322
train_data = processed_data.loc[processed_data['Class'] == 1].copy()

examples/regular/models/creditcard_wgan.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
print('Dataset columns: {}'.format(num_cols))
2020
sorted_cols = ['V14', 'V4', 'V10', 'V17', 'V12', 'V26', 'Amount', 'V21', 'V8', 'V11', 'V7', 'V28', 'V19', 'V3', 'V22', 'V6', 'V20', 'V27', 'V16', 'V13', 'V25', 'V24', 'V18', 'V2', 'V1', 'V5', 'V15', 'V9', 'V23', 'Class']
2121
processed_data = data[ sorted_cols ].copy()
22-
processed_data['Class'] = processed_data['Class'].apply(lambda x: 1 if x == "'1'" else 0)
2322

2423
#For the purpose of this example we will only synthesize the minority class
2524
train_data = processed_data.loc[processed_data['Class'] == 1].copy()
@@ -41,7 +40,7 @@
4140
batch_size = 128
4241

4342
log_step = 100
44-
epochs = 300+1
43+
epochs = 500+1
4544
learning_rate = 5e-4
4645
beta_1 = 0.5
4746
beta_2 = 0.9

0 commit comments

Comments
 (0)