From d9eeaaf00a4bc2fd0cf597896f97ffa1567dbb8b Mon Sep 17 00:00:00 2001 From: Daniel Ho Date: Wed, 12 Sep 2018 09:17:56 -0700 Subject: [PATCH] [tune] Fix bug in example where config hyperparameters were ignored (#2860) A fix to an example for tune (`python/ray/tune/examples/pbt_tune_cifar10_with_keras.py`) where the hyperparameters for the optimizer, learning rate and decay, were not being passed into the optimizer. This means that the current optimizer uses default values for the hyperparameters no matter the config. --- python/ray/tune/examples/pbt_tune_cifar10_with_keras.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/ray/tune/examples/pbt_tune_cifar10_with_keras.py b/python/ray/tune/examples/pbt_tune_cifar10_with_keras.py index 11163f722..28575f546 100755 --- a/python/ray/tune/examples/pbt_tune_cifar10_with_keras.py +++ b/python/ray/tune/examples/pbt_tune_cifar10_with_keras.py @@ -110,7 +110,8 @@ class Cifar10Model(Trainable): x_train = self.train_data[0] model = self._build_model(x_train.shape[1:]) - opt = tf.keras.optimizers.Adadelta() + opt = tf.keras.optimizers.Adadelta( + lr=self.config["lr"], decay=self.config["decay"]) model.compile( loss="categorical_crossentropy", optimizer=opt,