From 35bcff54502dcc6fb2fc24de56bf27c1936ae6f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Tue, 5 Nov 2019 11:16:48 +0800 Subject: [PATCH] Fix error in OneCycleSchedule._interpolate(), fixes #56 --- 11_training_deep_neural_networks.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/11_training_deep_neural_networks.ipynb b/11_training_deep_neural_networks.ipynb index a9f798f..f8fe953 100644 --- a/11_training_deep_neural_networks.ipynb +++ b/11_training_deep_neural_networks.ipynb @@ -1679,7 +1679,7 @@ " self.last_rate = last_rate or self.start_rate / 1000\n", " self.iteration = 0\n", " def _interpolate(self, iter1, iter2, rate1, rate2):\n", - " return ((rate2 - rate1) * (iter2 - self.iteration)\n", + " return ((rate2 - rate1) * (self.iteration - iter1)\n", " / (iter2 - iter1) + rate1)\n", " def on_batch_begin(self, batch, logs):\n", " if self.iteration < self.half_iteration:\n", @@ -2618,7 +2618,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.8" + "version": "3.7.4" }, "nav_menu": { "height": "360px",