Skip to content

Commit c8aa254

Browse files
Update phishing_email_detection_gpt2.py
Stop using Gradient accumulation steps and try adding perplexity metric to the model.
1 parent a66c93a commit c8aa254

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

phishing_email_detection_gpt2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
learning_rate = 3 * 10 ** -4 # 3 * 10 ** -3
6666
epochs = 15 #
6767
batch_size = 7 # 17
68-
gradient_accumulation_steps = 2
68+
gradient_accumulation_steps = 1
6969
minimum_levels = 2
7070
maximum_levels = 2 # [3,7]
7171

@@ -568,6 +568,7 @@ def from_config(cls, config):
568568
learning_rate=learning_rate,
569569
loss=tf.keras.losses.CategoricalCrossentropy(),
570570
metrics=[tf.keras.metrics.CategoricalAccuracy(),
571+
tf.keras.metrics.Perplexity(name='perplexity'),
571572
# tf.keras.metrics.Accuracy()
572573
],
573574
epochs=epochs,

0 commit comments

Comments
 (0)