Skip to content

Commit

Permalink
Model tests use smaller learning rate to catch performance regression.
Browse files Browse the repository at this point in the history
  • Loading branch information
james-choncholas committed Jan 20, 2025
1 parent 368f3b1 commit 6f6dea8
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 10 deletions.
3 changes: 0 additions & 3 deletions tf_shell_ml/test/dpsgd_conv_model_local_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ def _test_model(self, disable_encryption, disable_masking, disable_noise, cache)
metrics=[tf.keras.metrics.CategoricalAccuracy()],
)

m.build([None, 28 - (2 * clip_by), 28 - (2 * clip_by), 1])
m.summary()

history = m.fit(
features_dataset,
labels_dataset,
Expand Down
4 changes: 2 additions & 2 deletions tf_shell_ml/test/dpsgd_model_distrib_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_model(self):
lambda read_from_cache: tf_shell.create_autocontext64(
log2_cleartext_sz=25,
scaling_factor=1,
noise_offset_log2=2,
noise_offset_log2=0,
read_from_cache=read_from_cache,
cache_path=cache,
),
Expand All @@ -119,7 +119,7 @@ def test_model(self):

m.compile(
loss=tf.keras.losses.CategoricalCrossentropy(),
optimizer=tf.keras.optimizers.Adam(0.1),
optimizer=tf.keras.optimizers.Adam(0.01, beta_1=0.8),
metrics=[tf.keras.metrics.CategoricalAccuracy()],
)

Expand Down
2 changes: 1 addition & 1 deletion tf_shell_ml/test/dpsgd_model_float64_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _test_model(self, disable_encryption, disable_masking, disable_noise, cache)

m.compile(
loss=tf.keras.losses.CategoricalCrossentropy(),
optimizer=tf.keras.optimizers.Adam(0.1),
optimizer=tf.keras.optimizers.Adam(0.01, beta_1=0.8),
metrics=[tf.keras.metrics.CategoricalAccuracy()],
)

Expand Down
2 changes: 1 addition & 1 deletion tf_shell_ml/test/dpsgd_model_local_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _test_model(self, disable_encryption, disable_masking, disable_noise, cache)

m.compile(
loss=tf.keras.losses.CategoricalCrossentropy(),
optimizer=tf.keras.optimizers.Adam(0.1),
optimizer=tf.keras.optimizers.Adam(0.01, beta_1=0.8),
metrics=[tf.keras.metrics.CategoricalAccuracy()],
)

Expand Down
2 changes: 1 addition & 1 deletion tf_shell_ml/test/postscale_model_distrib_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def test_model(self):

m.compile(
loss=tf.keras.losses.CategoricalCrossentropy(),
optimizer=tf.keras.optimizers.Adam(0.1),
optimizer=tf.keras.optimizers.Adam(0.01, beta_1=0.8),
metrics=[tf.keras.metrics.CategoricalAccuracy()],
)

Expand Down
2 changes: 1 addition & 1 deletion tf_shell_ml/test/postscale_model_float64_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _test_model(self, disable_encryption, disable_masking, disable_noise, cache)

m.compile(
loss=tf.keras.losses.CategoricalCrossentropy(),
optimizer=tf.keras.optimizers.Adam(0.1),
optimizer=tf.keras.optimizers.Adam(0.01, beta_1=0.8),
metrics=[tf.keras.metrics.CategoricalAccuracy()],
)

Expand Down
2 changes: 1 addition & 1 deletion tf_shell_ml/test/postscale_model_local_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _test_model(self, disable_encryption, disable_masking, disable_noise, cache)

m.compile(
loss=tf.keras.losses.CategoricalCrossentropy(),
optimizer=tf.keras.optimizers.Adam(0.1),
optimizer=tf.keras.optimizers.Adam(0.01, beta_1=0.8),
metrics=[tf.keras.metrics.CategoricalAccuracy()],
)

Expand Down

0 comments on commit 6f6dea8

Please sign in to comment.